-
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
Poetry fails when Poetry's Python version differs from the active environment's Python version #354
Comments
Hmm, this issue may be deeper than I thought. If I call
I do have the following snippet in my pyproject.toml [tool.poetry.dependencies]
python = ">=3.4, <3.7" but I would expect Poetry to work since the active Python is Python 3.6.6. However, it seems that the faulty Python version detection I pointed to for |
Looking again through past issues, what I'm describing here may be related to #172. |
Hi @sdispater - Has this issue been resolved with a recent change? I don't see a recently linked PR that would explain the close. |
Hey @sdispater, just checking in again to understand why this issue was closed, since it's not clear to me. |
Hey @brycedrennan, I noticed you reopened #172. You may be interested in taking a quick look at this issue, which I believe is related. |
Thanks for the example! |
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. |
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).OS version and name: macOS 10.13.6
Poetry version: 0.11.3
Link of a Gist with the contents of your pyproject.toml file: not relevant
Issue
This is a minor issue. Poetry names the virtual environments it creates using the Python version it is running under, which I think is incorrect. Instead, it should use the Python version currently active.
For example, say I install Poetry with my Homebrewed Python, which is at Python 3.7.0. But inside a specific project, I have Python 3.6.6 activated via pyenv. This is what happens:
myproject$ python --version Python 3.6.6 myproject$ which python .../.pyenv/shims/python myproject$ poetry shell Creating virtualenv myproject-py3.7 in .../Library/Caches/pypoetry/virtualenvs Spawning shell within .../Library/Caches/pypoetry/virtualenvs/myproject-py3.7 myproject$ python --version Python 3.6.6
I believe the cause of this confusing discrepancy between the venv name and the active Python version is here. Instead of querying its own Python version, Poetry should query the version of the Python that would be invoked when it creates the virtual environment.
The text was updated successfully, but these errors were encountered: