Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Using Your New Python

Marc Andreu on April 14, 2022

Hello I am on Ubuntu 20.04 and I am just starting with pyenv. I had Python system 2.7, 3.8 and 3.9 installed.

It looks like py pyenv is not setting up the python version when I use pyenv global command.

This are the outputs of the commands after doing pyenv global 3.9.1

  ~ pyenv versions
  system
  3.10.4
* 3.9.1 (set by /home/user/.pyenv/version)
  ~ python -V
Python 2.7.18
  ~ python3 -V
Python 3.8.10
  ~ ls /bin/pyth*
/bin/python   /bin/python2.7  /bin/python3.8         /bin/python3.9
/bin/python2  /bin/python3    /bin/python3.8-config  /bin/python3-config

What could be the problem?

Geir Arne Hjelle RP Team on April 14, 2022

@Marc Andreu

Have you restarted your terminal after installing pyenv? It could be that paths are not yet properly set up. You may also need to manually add the initialization of pyenv to your .bashrc file, possibly with the change discussed here: github.com/pyenv/pyenv/issues/2198

Marc Andreu on April 14, 2022

Yes thanks Geir,

I have submitted a PR to fix the pyenv Readme file docs. github.com/pyenv/pyenv/pull/2326

I found the solution I had to modify the .zshrc from

eval "$(pyenv init --)";

to

eval "$(pyenv init --path)";

Geir Arne Hjelle RP Team on April 14, 2022

@Marc

Cool, hopefully the docs will work better for the next ones installing pyenv. Thanks for taking the time to submit the PR! 👏‍

Become a Member to join the conversation.