You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While system Python is 3.10, I have Python 3.9 available and active using pyenv.
Poetry correctly detects that the system Python version is incompatible with the Project and prints that it will use version 3.9, however the venv is created with the wrong python version:
$ cat .python-version3.9.10
$ pythonPython 3.9.10 (main, Feb 1 2022, 12:54:42)[GCC 11.1.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>
$ which python/home/user/.pyenv/shims/python
$ /usr/bin/pythonPython 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>
$ poetry install # Poetry is 1.1.13The currently activated Python version 3.10.2 is not supported by the project (>=3.8,<3.10).Trying to find and use a compatible version.Using python3 (3.9.10)Creating virtualenv my-project-SwvjWCYu-py3.9 in /home/user/.cache/pypoetry/virtualenvsInstalling dependencies from lock file SolverProblemError The current project's Python requirement (3.10.2) is not compatible with some of the required packages Python requirement: - hcloud requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.10, so it will not be satisfied for Python 3.10.2
# install fails
$ . /home/user/.cache/pypoetry/virtualenvs/my-project-SwvjWCYu-py3.9/bin/activate(my-project-SwvjWCYu-py3.9) $ pythonPython 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>
Recreating the venv with the correct python version seems to resolve this problem:
$ rm -rf /home/user/.cache/pypoetry/virtualenvs/my-project-SwvjWCYu-py3.9
$ python -m venv /home/user/.cache/pypoetry/virtualenvs/my-project-SwvjWCYu-py3.9
$ poetry install
The currently activated Python version 3.10.2 is not supported by the project (>=3.8,<3.10).
Trying to find and use a compatible version.«
Using python3 (3.9.10)
Installing dependencies from lock file
Package operations: 65 installs, 0 updates, 0 removals
# install succeeds fine
Although this seems somewhat related to #5252, it seems to me like this is indeed a slightly different bug:
If Poetry detects that 3.9 is required and creates a venv called 3.9, that venv should not be running 3.10.
The text was updated successfully, but these errors were encountered:
General info
pyproject.toml
Issue
While system Python is 3.10, I have Python 3.9 available and active using pyenv.
Poetry correctly detects that the system Python version is incompatible with the Project and prints that it will use version 3.9, however the venv is created with the wrong python version:
Recreating the venv with the correct python version seems to resolve this problem:
Although this seems somewhat related to #5252, it seems to me like this is indeed a slightly different bug:
If Poetry detects that 3.9 is required and creates a venv called 3.9, that venv should not be running 3.10.
The text was updated successfully, but these errors were encountered: