3

I am trying to make Python version 3.9.1 my default python version. When I type “python —version” into terminal, it returns Python 2.7.16.

"whereis python3 returns "/usr/bin/python3". So, I change the alias with “alias python=/usr/local/bin/python3”. This temporarily sets my version to python3. In terminal, “python —version” returns "Python 3.9.1" and I can run Python 3.9.1 in the terminal by typing "python". Great.

However, this change is temporary. If I exit the shell and reenter, or open a new tab, I have to repeat the process. How do I make this permanent?

Also, will this cover everything on my OS that points to Python 2? For instance, will pip now point to Python3 and not 2? Thank you!

1 Answers1

3

I will suggest to use pyenv (https://github.com/pyenv/pyenv) for managing differrent python versions on your machine. Other system programs which depends on py2 may break if you just relink python command to new version.

ilov3
  • 427
  • 2
  • 7