Poetry does not use active pyenv when creating virtual environment
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: MacOS 10.14 Mojave
-
Poetry version: 0.12.8
Issue
I have a project directory with a .python-version
file like this:
3.7.1
Poetry has been installed into Python 3.6.5. According to recent comments, poetry is supposed to detect the active Python version when creating a new virtual environment, but it seems to stick with 3.6.5 all the time. To illustrate:
$ python --version
Python 3.7.1
$ poetry run python --version
Python 3.6.5
When I specify python = "^3.7"
in `pyproject.toml I get an error:
$ poetry shell
[RuntimeError]
The current Python version (3.6.5) is not supported by the project (^3.7)
Please activate a compatible Python version.
shell
Issue Analytics
- State:
- Created 5 years ago
- Reactions:30
- Comments:53 (20 by maintainers)
Top Results From Across the Web
Using Poetry with PyEnv and having Python version issues
I can do a pyenv local 3.10.0 without any issue and the project uses it. But using the poetry env use command errors...
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 >Why You Should Use Pyenv & Poetry for Python Projects
Poetry is much more than the virtual environment. When you initialize the project with Poetry it creates a virtual environment specific to the...
Read more >Setting Up Python: pyenv, pyenv-virtualenv, poetry
These are steps to install and set up Python on a Mac. ... Manager: pyenv; Virtual Environment: pyenv-virtualenv; Package Manager: poetry.
Read more >A Poetic Apology. Or Why Should You Use Poetry to Manage…
Since this is not your first Python project and you want to avoid spending more ... pyenv-virtualenv, which makes managing venvs even more...
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 FreeTop 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
Top GitHub Comments
Thanks @princelySid. That would be
poetry env use $(pyenv which python)
for pyenv users with an active pyenv interpreter.poetry
installed withinstall-poetry.py
to enablepoetry self update
. Same problem withpyenv
python version.It seems to work with explicit virtual env creation with:
Versions: