-
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
PyEnv + Poetry: Poetry does not use correct Python versions #5252
Comments
Try |
This won't work if you use pyenv. Are you using |
Do you have some other Python installed, e.g. from homebrew? The version you have 3.10.2 is not one of the versions that you have with pyenv so must have come from somewhere else. Do you have PYTHONPATH set? I've had similar problem where that env var was set to a different version and the pyenv local as set by .python_version was being ignored. |
Creating a venv with the current active Python on When Poetry was installed in any other way ( One can point Poetry to a specific Python binary that should be used to create the venv, by running
You can not use With the next alpha release there will be an option experimental option fin swimmer |
I believe I recently encountered a very similar issue - while using A workaround that worked for me was to deactivate the poetry virtualenv: poetry env use system If I understand correctly, what was happening was that I apologize if I'm saying something obvious, if this was explained before it was not really clear to me before some debugging. |
@finswimmer Your solution doesnt work with a windows computer. I am using pyenv-win and even when I successfully create a shell it still installs the previous python version. I am attempting to go from python 3.9.6 to 3.9.11 These are my steps:
poetry installs 3.9.6 instead of 3.9.11 I am using poetry version 1.1.12( I just realized I have an issue with updating to 1.1.13), Windows 11, Pyenv-win 2.64.11 |
Hello @thoughtfuldata,
unfortunately this will not work. The Furthermore poetry 1.2.0b1 is out which now contains the experimental option |
I use
and it worked |
Good point @shaoye! An alternative workaround, which is also platform-independent:
Explanation:
|
This solution does not work for me. I am on poetry 1.5.1 and when i run
I get
you can see that the poetry environment is referencing a python 3.8. even |
This usually works for me
|
Using the pyshell won't work in an automated way. I did something like this in my bash script.
|
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 12.01
Poetry version: 1.1.13
Issue
I find it extremely challenging, i.e. impossible, to get poetry to use the correct Python version. I am using PyEnv to manage Python.
BUT within projectA:
Even though:
I have zero clue what I am doing wrong. Reading a couple of online resources did not help my understanding much. However obvious this is for core users, it is extremely frustrating and counterintuitive for me.
How to set this up correctly?
See also:
The text was updated successfully, but these errors were encountered: