Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

poetry shell cannot work

未关闭
#6 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
anaconda, python
领域
cli

调研方向

首先在使用 Anaconda 的 Windows 上复现列出的 poetry new、conda activation、poetry run 和 poetry shell 命令,然后比较显示环境已激活的详细运行时日志。检查插件对 Windows shell 的处理,并在 poetry shell 不再报告缺少 activate.bat 命令且打开预期的 shell 时验证完成情况。

由索引模型根据 Issue 内容生成。

描述

Description

I try to run code from https://python-poetry.org/docs/basic-usage/#using-poetry-run, but it reports error...

poetry new project
cd project
conda activate your_env_name
which python
poetry run which python
poetry shell
which python
C:\Users\Administrator\Personal_scripts\Python\PythonScripts\ddd\poetry-demo>activate python312

(python312) C:\Users\Administrator\Personal_scripts\Python\PythonScripts\ddd\poetry-demo>which python
/c/ProgramData/anaconda3/envs/python312/python

(python312) C:\Users\Administrator\Personal_scripts\Python\PythonScripts\ddd\poetry-demo>poetry run which python
/c/ProgramData/anaconda3/envs/python312/python

(python312) C:\Users\Administrator\Personal_scripts\Python\PythonScripts\ddd\poetry-demo>poetry shell
Spawning shell within C:\ProgramData\anaconda3\envs\python312
'C:\ProgramData\anaconda3\envs\python312\Scripts\activate.bat' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

(python312) C:\Users\Administrator\Personal_scripts\Python\PythonScripts\ddd\poetry-demo>

不是内部或外部命令,也不是可运行的程序
或批处理文件。

It's mean: It is not an internal or external command, nor is it a runnable program
Or batch file.

Workarounds

No....

Poetry Installation Method

system package manager (eg: dnf, apt etc.)

Operating System

Win10 Enterprise 21H2

Poetry Version

1.8.3

Poetry Configuration
(python312) C:\ProgramData\anaconda3\envs\python312>poetry config --list
cache-dir = "C:\\Users\\Administrator\\AppData\\Local\\pypoetry\\Cache"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}\\virtualenvs"  # C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true
Python Sysconfig
(python312) C:\ProgramData\anaconda3\envs\python312>python -m sysconfig
Platform: "win-amd64"
Python version: "3.12"
Current installation scheme: "nt"

Paths:
        data = "C:\ProgramData\anaconda3\envs\python312"
        include = "C:\ProgramData\anaconda3\envs\python312\Include"
        platinclude = "C:\ProgramData\anaconda3\envs\python312\Include"
        platlib = "C:\ProgramData\anaconda3\envs\python312\Lib\site-packages"
        platstdlib = "C:\ProgramData\anaconda3\envs\python312\Lib"
        purelib = "C:\ProgramData\anaconda3\envs\python312\Lib\site-packages"
        scripts = "C:\ProgramData\anaconda3\envs\python312\Scripts"
        stdlib = "C:\ProgramData\anaconda3\envs\python312\Lib"

Variables:
        BINDIR = "C:\ProgramData\anaconda3\envs\python312"
        BINLIBDEST = "C:\ProgramData\anaconda3\envs\python312\Lib"
        EXE = ".exe"
        EXT_SUFFIX = ".cp312-win_amd64.pyd"
        INCLUDEPY = "C:\ProgramData\anaconda3\envs\python312\Include"
        LIBDEST = "C:\ProgramData\anaconda3\envs\python312\Lib"
        TZPATH = "C:\ProgramData\anaconda3\envs\python312\share\zoneinfo"
        VERSION = "312"
        VPATH = "..\.."
        abiflags = ""
        base = "C:\ProgramData\anaconda3\envs\python312"
        exec_prefix = "C:\ProgramData\anaconda3\envs\python312"
        installed_base = "C:\ProgramData\anaconda3\envs\python312"
        installed_platbase = "C:\ProgramData\anaconda3\envs\python312"
        platbase = "C:\ProgramData\anaconda3\envs\python312"
        platlibdir = "DLLs"
        prefix = "C:\ProgramData\anaconda3\envs\python312"
        projectbase = "C:\ProgramData\anaconda3\envs\python312"
        py_version = "3.12.0"
        py_version_nodot = "312"
        py_version_nodot_plat = "312"
        py_version_short = "3.12"
        srcdir = "C:\ProgramData\anaconda3\envs\python312"
        userbase = "C:\Users\Administrator\AppData\Roaming\Python"
Example pyproject.toml

No response

Poetry Runtime Logs
(python312) C:\Users\Administrator\Personal_scripts\Python\PythonScripts\ddd\poetry-demo>poetry -vvv shell
Loading configuration file C:\Users\Administrator\AppData\Roaming\pypoetry\config.toml
Using virtualenv: C:\ProgramData\anaconda3\envs\python312
Virtual environment already activated: C:\ProgramData\anaconda3\envs\python312
主要语言
Python
星标
141
派生
10
平均合并
59 分钟
30 天内合并 PR
3

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python-poetry/poetry-plugin-shell 的其他 Issue

查看 python-poetry/poetry-plugin-shell 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。