`poetry shell` and `poetry run` access different pip instances
还没有人认领这个 Issue。
评估
调研方向
使用 poetry install、poetry run pip --version 和 poetry shell,复现 issue 中所述的空目录设置下的差异,然后检查其中描述的 shell 激活和环境变量行为。完成的标准是:启动的 shell 中的 pip 解析到与 poetry run pip 相同的虚拟环境和 pip 实例,包括报告的 which pip 路径。
由索引模型根据 Issue 内容生成。
描述
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: macOS Big Sur 11.6.4 (20G417)
- Poetry version: 1.1.13
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/itcarroll/f46c6dbc6f53da88e7715f877be41452
Issue
I'm getting different pip instances depending on whether I use poetry run pip or start a new shell with poetry shell. The correct one is poetry run pip. The pip that poetry shell uses is wrong, and is not even at the path given by which pip. A clue might be that poetry shell has an extra environment variable also pointing to the wrong venv: __PYVENV_LAUNCHER__=/Users/icarroll/.local/pipx/venvs/poetry/bin/python.
Starting in an empty directory containing only pyproject.toml, here's what I'm seeing:
% poetry install
Creating virtualenv bug-report-f5FbZAGT-py3.8 in /Users/icarroll/Library/Caches/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.1s)
Writing lock file
% poetry run pip --version
pip 22.0.3 from /Users/icarroll/Library/Caches/pypoetry/virtualenvs/bug-report-f5FbZAGT-py3.8/lib/python3.8/site-packages/pip (python 3.8)
% poetry shell
Spawning shell within /Users/icarroll/Library/Caches/pypoetry/virtualenvs/bug-report-f5FbZAGT-py3.8
Restored session: Tue Mar 8 18:54:56 EST 2022
% . /Users/icarroll/Library/Caches/pypoetry/virtualenvs/bug-report-f5FbZAGT-py3.8/bin/activate
(bug-report-f5FbZAGT-py3.8) % pip --version
pip 22.0.4 from /Users/icarroll/.local/pipx/shared/lib/python3.8/site-packages/pip (python 3.8)
(bug-report-f5FbZAGT-py3.8) % which pip
/Users/icarroll/Library/Caches/pypoetry/virtualenvs/bug-report-f5FbZAGT-py3.8/bin/pip
- 主要语言
- Python
- 星标
- 141
- 派生
- 10
- 平均合并
- 59 分钟
- 30 天内合并 PR
- 3
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-poetry/poetry-plugin-shell 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 20/100
python-poetry/poetry-plugin-shell#43 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 52/100
python-poetry/poetry-plugin-shell#42 · 4 条评论 · 15 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 38/100
python-poetry/poetry-plugin-shell#40 · 4 条评论 · 2 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 42/100
python-poetry/poetry-plugin-shell#37 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
python-poetry/poetry-plugin-shell#34 · 1 条评论 ·
查看 python-poetry/poetry-plugin-shell 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
instance instance add
难度 2/5 1-3 小时 新手友好度 68/100
searxng/searx-instances#941 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
FluidNumerics/fluid-walk-blocker#89 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复