I have both python3.6 and python3.5 on ubuntu (zesty beta 2). I know that
python calls python2.7. The problem is, when I call
python3, it automatically starts python3.5 instead of python3.6.
Is there a better way to fix this than an alias?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
As an alternative to aliases you can use
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
This command will create a link in:
I'm not sure if it's a good idea, maybe an update makes it broken.
An other options is creating a link to desired version of python in
~/bin then adding this path to the $PATH environment variable:
Or within your .profile:
Regarding your actual question (whether it's a good idea or not, I leave aside), you can check your /usr/bin/python3 version (in my case it was 3.4 ), and replace it with the new version:
$ python3 -V Python 3.4.9 $ ls -lh /usr/bin/python3 lrwxrwxrwx. 1 root root 9 Dec 5 16:35 /usr/bin/python3 -> python3.4 $ sudo mv /usr/bin/python3 /usr/bin/_python3 $ sudo cp /usr/bin/python3.6 /usr/bin/python3 $ python3 -V Python 3.6.6