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 install reported python version and installed venv python version differ #4207

Closed
2 of 3 tasks
stohrendorf opened this issue Jun 24, 2021 · 2 comments
Closed
2 of 3 tasks
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@stohrendorf
Copy link

Issue

I used the new installer, which installed poetry using python 3.8.5. Additionally, I have installed conda, with a python 3.9.5 virtual environment, which is prefixed to $PATH so it is preferred over the system installed python version - this was added after installing poetry.

When doing a poetry install without any existing prior virtualenv, the following is printed to the console:

$ poetry install
The currently activated Python version 3.8.5 is not supported by the project (3.9.5).
Trying to find and use a compatible version. 
Using python3 (3.9.5)
Creating virtualenv ghd-m2Y1OWxf-py3.9 in /home/steffen/.cache/pypoetry/virtualenvs
Installing dependencies from lock file

Package operations: 55 installs, 0 updates, 0 removals
<<< snip >>>

poetry correctly reports that it uses python 3.9.5, as this exact version is specified in pyproject.toml. However...

$ /home/steffen/.cache/pypoetry/virtualenvs/ghd-m2Y1OWxf-py3.9/bin/python --version
Python 3.8.5
/usr/bin/python3 --version
Python 3.6.13
/home/steffen/.local/share/pypoetry/venv/bin/python3 --version
Python 3.8.5
$ which python3
/home/steffen/miniconda3/envs/python-3.9/bin/python3
$ python3 --version
Python 3.9.5

which is clearly not python 3.9.5. The creation of the virtualenv can be done correctly if I'm doing a poetry env use $(which python3), but this shouldn't be necessary as poetry reported it was using the correct version.

@finswimmer
Copy link
Member

Hey,

this should now work correctly by setting virtualenvs.prefer-active-python to true.

fin swimmer

Copy link

github-actions bot commented Mar 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants