Unable to create poetry environment with python3.10
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
OS version and name: Ubuntu 20.04.4 LTS
-
Poetry version: 1.1.13
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/ethanabrooks/1ec5eada2e26f346b83eb46a4bdebc8b
Issue
I am unable to create a poetry environment with python3.10.
> poetry shell
The currently activated Python version 3.8.10 is not supported by the project (^3.10).
Trying to find and use a compatible version.
Using python3.10 (3.10.4)
Creating virtualenv poetry-issue-wxXJaBmj-py3.10 in /home/ethanbro/.cache/pypoetry/virtualenvs
Virtual environment already activated: /home/ethanbro/.cache/pypoetry/virtualenvs/poetry-issue-wxXJaBmj-py3.10
> which python
/usr/bin/python
> ls /home/ethanbro/.cache/pypoetry/virtualenvs/poetry-issue-wxXJaBmj-py3.10
lib local pyvenv.cfg
As you can see, there is no bin/
directory under /home/ethanbro/.cache/pypoetry/virtualenvs/poetry-issue-wxXJaBmj-py3.10
.
If I change my pyproject.toml
to python3.9
and then run poetry env use $(which python3.9)
, everything works fine (the virtualenv has a bin
directory).
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:8
Top Results From Across the Web
Configure a virtual environment | PyCharm Documentation
Press Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. · Expand the list of the available interpreters...
Read more >Managing environments | Documentation - Poetry
By default, Poetry will try to use the Python version used during Poetry's installation to create the virtual environment for the current project....
Read more >I am unable to create a new virtualenv in ubuntu?
I got the error while updating dependencies with poetry. Uninstalling virtualenv package that was present in the venv (probably as subdependency ...
Read more >Dependency Management With Python Poetry
When your Python project relies on external packages, you need to make sure you're using the right version of each package.
Read more >Installing and using virtualenv with Python 3
Although you can create a virtual environment using venv with Python3, it's recommended that you install and use virtualenv instead.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Poetry Preview Release 1.2.0b1 addresses this issue:
Steps to get a working environment:
curl -sSL https://install.python-poetry.org | python3 - --preview
poetry config virtualenvs.prefer-active-python true
Now poetry will respect the pyenv activated python and workflow returns to normal:
poetry install
cat .venv/pyvenv.cfg
# expecting python 3.10.5See Docs: Managing environments for additional details.
I tried uninstalling and reinstalling, but still encountering the same issue. I am not using pyenv, for the record.