poetry always uses wrong python version
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.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: macOS mojave
- Poetry version: 1.1.4
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/magnusja/4a3c11b310d5e3a70e7186593310b5d5
Issue
~/D/c/d/backend.service.ocr 🔥🔥 cat .python-version
3.8.6⏎
~/D/c/d/backend.service.ocr 🔥🔥 python --version
Python 3.8.6
~/D/c/d/backend.service.ocr 🔥🔥 pyenv shell 3.8.6 # just to be really sure ..
~/D/c/d/backend.service.ocr 🔥🔥 poetry install
The currently activated Python version 3.9.0 is not supported by the project (3.8.6).
Trying to find and use a compatible version.
Using python3 (3.8.6)
Installing dependencies from lock file
Package operations: 82 installs, 0 updates, 0 removals
• Installing ipython-genutils (0.2.0): Cancelled
~/D/c/d/backend.service.ocr [1] 🔥🔥 poetry run python --version
The currently activated Python version 3.9.0 is not supported by the project (3.8.6).
Trying to find and use a compatible version.
Using python3 (3.8.6)
Python 3.9.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Poetry using the wrong Python version (not related to pyenv)
Poetry should implicitly create a built-in virtual environment with the Python version specified by the tool.poetry.dependencies.python property ...
Read more >Poetry doesn't use the correct version of Python - Stack Overflow
The currently activated Python version 2.7.16 is not supported by the project (^3.8). Trying to find and use a compatible version.
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 >Select python interpreter in poetry | by Jamie Thomson - Medium
I used poetry to discover the version of python currently being used in the project: As you can see it is using python...
Read more >Poetry Advance - Python Biella Group
If you just wish to define the most recent version, use “*.” You may also define the Python version necessary to run the...
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
So I couldnt really believe that, and wrote a little test script:
which gives
so clearly it is possible for poetry to get the correct python env.
Also imho if this is expected behavior you are following an incredibly bad & flawed UX. Basically poetry is telling me it is using python 3.8 and lying to my face instead of throwing an error. It took me quite a while to figure that out …
The
env
also seems broken