How to upgrade Python version from 3.8.2 to 3.8.5 for an existing poetry environment?
See original GitHub issueHow to upgrade Python version for existing poetry environment?
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Issue
I manage Python versions via pyenv. But I can’t convince poetry to load Python 3.8.5 when the environment is activated. It keeps using 3.8.2.
➜ my-project python -V
Python 3.8.5
➜ my-project pyenv versions
* 3.8.5 (set by /home/raffael/PycharmProjects/my-project/.python-version)
➜ my-project poetry shell
Spawning shell within /home/raffael/.cache/pypoetry/virtualenvs/my-project-L-QBB5_N-py3.8
➜ my-project . /home/raffael/.cache/pypoetry/virtualenvs/my-project-L-QBB5_N-py3.8/bin/activate
(my-project-L-QBB5_N-py3.8) ➜ my-project python -V
Python 3.8.2
(my-project-L-QBB5_N-py3.8) ➜ my-project pyenv shell 3.8.5
(my-project-L-QBB5_N-py3.8) ➜ my-project pyenv local 3.8.5
(my-project-L-QBB5_N-py3.8) ➜ my-project python -V
Python 3.8.2
(my-project-L-QBB5_N-py3.8) ➜ my-project poetry env use 3.8.5
Using virtualenv: /home/raffael/.cache/pypoetry/virtualenvs/my-project-L-QBB5_N-py3.8
(my-project-L-QBB5_N-py3.8) ➜ my-project python -V
Python 3.8.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Change python version to 3.x - Stack Overflow
Simply changing python = "^2.7" to python = "^3.7" results in the following error when poetry install is run: [SolverProblemError] The current ......
Read more >Upgrade Your Python Project With Poetry | The NTC Mag
Manage Python dependencies and virtual environment with Poetry ... poetry install The currently activated Python version 2.7.16 is not ...
Read more >Installing and using virtualenv with Python 3
You must first install a custom version of Python 3. This custom installation of Python 3 will also contain pip3. After it's installed...
Read more >Managing environments | Documentation - Poetry
Switching between environments For this specific purpose, you can use the env use command to tell Poetry which Python version to use for...
Read more >How To Install Poetry to Manage Python Dependencies on ...
txt . In this tutorial you will install Poetry using the official installation script, set up a Poetry project with a virtual environment,...
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
Isn’t that a tiny bit ironic that a dependency management system for Python cannot manage the most central dependency - that of the interpreter itself?
Apparently pyenv uses shivs to intercept and reference to python so that it can point to its versions, but this doesn’t work when poetry calls python. In my case it is using the default system python version 3.8.5 when the global pyenv version I have is 3.8.10. There is no way for me to change the version poetry uses the version I set using pyenv.
Please can poetry link with pyenv somehow so that poetry uses the pyenv version I set as default?