1

with python 2 reaching EOL how to make python3 the default python ? ... system wide not just a specific script

should we do a symbolic link ?

sudo ln -s /usr/bin/python3 /usr/local/bin/python

or possibly

sudo update-alternatives --set python /usr/bin/python3 

Does it matter which ? I am on a box without python 2 so I have no python 2 specific libraries to deal with.

of course just making below edit to your ~/.bashrc will only impact one user

alias python=python3

I am looking for a system wide change for all processes and userids not just me

Scott Stensland
  • 14,755
  • 10
  • 55
  • 73
  • 6
    [PEP394](https://legacy.python.org/dev/peps/pep-0394/) says "Don't do that!" See previous thread on the topic: [How to make 'python' program command execute Python 3?](https://askubuntu.com/questions/320996/how-to-make-python-program-command-execute-python-3) – user535733 Feb 15 '20 at 14:43
  • @user535733 that answer is only good for one user it does no system wide change – Scott Stensland Feb 15 '20 at 22:36
  • Read a bit farther down that duplicate - both of your proposed methods are addressed. – user535733 Feb 15 '20 at 22:50

0 Answers0