question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to upgrade Python version from 3.8.2 to 3.8.5 for an existing poetry environment?

See original GitHub issue

How 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
joyofdatacommented, Aug 24, 2020

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?

2reactions
Zaffercommented, Jun 25, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found