Two python versions on Ubuntu

Asked

Viewed 73 times

-2

I think there is something wrong with my pc. It shows that both python 3.5.2 and 2.7.12 are default. How to fix this?

And I tried to update the version of Ubuntu from 16.04 to 18.04 and I appeared an msg saying that it is not possible to update my python 3 is corrupted, I imagine it is because of this problem I described?

Anybody know what I should do? Thank you

  • normal have py2 and py3 installed, unfortunately I do not know how to help to fix py3, curiously yesterday I went to upgrade to mint20 and also had an error, in the end I decided to make a new installation

1 answer

0

Try setting the default Python as the 3.5 using the command:

sudo ln -sf /usr/bin/python3.5 /usr/bin/python3

If this doesn’t work, you can reinstall the packages from python3 using the command:

sudo apt-get install --reinstall python3

If it still doesn’t work, remove all packages python of update-alternatives and set Python 2.7 as standard using the commands:

sudo update-alternatives --remove-all python
sudo ln -sf /usr/bin/python2.7 /usr/bin/python

Browser other questions tagged

You are not signed in. Login or sign up in order to post.