Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry shell and poetry run access different pip instances #15

Open
3 tasks done
itcarroll opened this issue Mar 9, 2022 · 0 comments
Open
3 tasks done

poetry shell and poetry run access different pip instances #15

itcarroll opened this issue Mar 9, 2022 · 0 comments

Comments

@itcarroll
Copy link

  • 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 (-vvv option).

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
@Secrus Secrus transferred this issue from python-poetry/poetry Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant