-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
1.2.0 fails to recognise external active virtualenv #6565
Comments
I'm not sure what's going on here, but a clean reproduction in a container is needed. For me, the following works as expected (on Poetry 1.2.1): $ python -m venv /tmp/venv
$ . /tmp/venv/bin/activate
$ poetry install
$ poetry show
$ /tmp/venv/bin/pip list
|
// works for me both 1.2.0 and 1.2.1 as expected |
Its worth nothing that everything works for me as expected on macOS as well. I'm going to close this for now as neither of us can reproduce it reliably -- I suggest you inspect the shell environment after |
FWIW I've come across similar behaviour in both 1.2.0 and 1.2.1, and (in case it helps anyone else finding this thread) I fixed the issue by renaming the
In my situation, I've created a virtualenv also called
If I change the
This behaviour is reliable & consistent, i.e. change it back to |
@john-sandall you have a different issue -- please open a new issue if you can reproduce it in a container. |
(and please open a new issue if you have a reproduction for a closed issue, or a different manifestation with a different reproduction -- it's hard for people to see if you just comment on an existing (especially closed) issue) |
@neersighted sorry, but could it be that Poetry indeed has some bug that make it very fragile to discover if Venv is active or not ? poetry/src/poetry/utils/env.py Line 1689 in 93e23bc
according to venv docs sys.prefix or sys.exec_prefix should be used instead (https://docs.python.org/3/library/venv.html)
|
Our virtual environment detection mechanism is a bit complex as we do have a class-based |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Issue
External envs are not correctly detected by poetry 1.2.0
to reproduce (with default poetry config)
shows:
Creating virtualenv ${poetry_project_name}-Wz7GVy6b-py3.8 in /Users/myuser/Library/Caches/pypoetry/virtualenvs
when
poetry config virtualenvs.create false
is setthe above command produces:
as one can see poetry is trying to install to the system instead of the activated venv and fails (as expected) due to permissions
poetry env info doesn't show paths to the activated external venv:
The text was updated successfully, but these errors were encountered: