I installed anaconda and run 'sudo apt-get update && sudo apt-get dist-upgrade' on an Ubuntu 16.04 system. I upgraded pip inside an Anaconda environment and also used the 'sudo apt-get autoremove' command as well but not sure if those are related to the problem. So the problem is this:

enter image description here

For some reason the python3 symlink is dead (I'm assuming it previously pointed at python3.6). Is it safe for me to simply use update-alternatives to point the python3 symlink at /usr/bin/python3.5?

Thanks any help appreciated.

Edit: Also note that I found the Jonathonf PPA is being used on this system to get Python3.6. I found information on the internet that this repo is no longer active. Could that be the soure of the problem?


Confirm the python version with

python -V

and confirm the existence of the python binaries

  • /usr/bin/python3*
  • /usr/bin/python2*


sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 3

Once you have these options, try

sudo update-alternatives --config python

to select the best option from the list.

you may get something like this

$ sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path                Priority   Status
* 0            /usr/bin/python2.7   2         auto mode
  1            /usr/bin/python3.6   2         manual mode
  2            /usr/bin/python3.5   3         manual mode

Press <enter> to keep the current choice[*], or type selection number: 0
  • When I run 'python -V' I get: 'Python 2.7.12'. In my /usr/bin folder I have 2.7 and 3.5 binaries. The 'python3' symlink is red and seems to be dead. Can I still run the 'update-alternatives' command you suggest even though python3.6 binary is not in /usr/bin?
    – Kane
    Jul 4 '20 at 5:11
  • The output i included is just an example. I suggest you try the commands with python2.7 and python3.5, if after that you need python3.6 i suggest you install it or re-install it with apt. Jul 4 '20 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.