-
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 not using the correct python version #7075
Comments
Also this doesn't work:
This is rather frustrating... |
I really don't understand what pyenv is, I've never used it, and thus I'm not well placed to try to help here. Buuuut, if poetry isn't making the virtual environment, that means the user is, and that means it's on you? |
Then look it up... |
If you expect that Poetry picks up the current activated Python version, you have to set virtualenvs.prefer-active-python to true (https://python-poetry.org/docs/configuration/#virtualenvsprefer-active-python-experimental) |
I have and it still doesn't work... |
Even then the original output I posted is clearly a bug. It shouldn't be saying it's using python3 (3.10.7) when it actually isn't.
Not to mention that message also contradicts |
bugs notwithstanding, I wonder what you are trying to achieve here? You say you have configured poetry to prefer the active python, we can see you have configured poetry not to create a virtual environment - what are you hoping that If you want the python that's active and not a new virtual environment... just do nothing? |
You understand that poetry install doesn't just magically work right? It has to install the packages somewhere? Where do you think it will do that? If it installs the packages in python3.9 and I'm using python 3.10, how do you suppose this will work? |
where do you think it will do that? You have configured poetry not to create a virtual environment
Again: what are you expecting to happen? |
Reread everything I posted. I cannot make it any more clear... |
Yes, because I'm providing the environment. |
Hey @shanewazabbas, for further debugging please provide the output of From what I can see until now: "The currently activated Python version 3.9.14 is not supported by the project (>=3.10.1,<3.11)." indicated that you haven't set "Skipping virtualenv creation, as specified in config file." means you have set A wrong output of fin swimmer |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@shanewazabbas I believe we are suffering the same or similar issue. See discussion #6978. |
I’m having a similar issue where I have a terminal opened in a directory that contains a pyproject.toml with python pinned to python 3.10.8 and a .python-version file also set to 3.10.8. If I run |
Similar issue (using pyenv-win) where poetry seems to ignore From a new shell in the project directory:
Now, let's try to acivate another python version:
Looking good. Now, let's start poetry:
[WinError 2] The system cannot find the file specified* |
Same problem here, using poetry 1.4.1 on windows Global python version is 3.11.2 used to install poetry: λ pyenv global
3.11.2
λ python --version
Python 3.11.2 Test project requires python 3.10.10, and
However using poetry env use %HOME%\.pyenv\pyenv-win\shims\python.bat
Creating virtualenv test-project in ...\test_project\.venv
Using virtualenv: ...\test_project\.venv
λ poetry shell
Spawning shell within ...\test_project\.venv
(test-project-py3.10) ...\tutor_nicegui>python --version
Python 3.10.10 IMHO the documentation about pyenv should be clarified. |
I have the same issue. Looks like the reason is commit: #7471 |
A problem reported in November 2022 is certainly not caused by a commit made in February 2023 |
Yes, you are right, I'm not sure about the original issue. But "shell=True" can help people who left three last messages. Please look at example:
Thank you. |
well let's try to keep separate issues separate - please raise new issues for new problems. (perhaps we want a poetry/src/poetry/utils/env.py Line 545 in 161b19c
|
Hello @shanewazabbas, you haven't come back to this issue for a long while. So I assume this is solved in the meantime and I can close this ticket. Feel free to leave a comment if you disagree. fin swimmer |
It says using 3.10.7 but the last line says otherwise.
If I do poetry install, it chooses to still use 3.9.14
Keep in mind that I'm using pyenv and local
.python-version
fileThere is nothing crazy going on here on my end. How are we not able to handle just having the current python version be respected for poetry? I'm on a mac
The text was updated successfully, but these errors were encountered: