Originally Posted by
monkeybrain20122
Well you haven't explained what your problem is, and why do you have so many versions of python2 and 3???
I tried to run
Code:
# do-release-upgrade
and the script failed to run see my other thread
DO NOT try to remove python-2.7 since it is a dependency for many system components and if you remove it your system will break beyond repair.
I haven't
FYI 18.04 still uses python-2.7 as default so "upgrading" will not give you python3 as default, but it doesn't really matter though, as long as Ubuntu's team maintains it, the system's default python is just for maintenance, running and installing things.
That's why I need to fix this. The other versions of python were likely installed as dependencies of other packages. I didn't install them. IN fact the first part of the upgrade runs a script named bionic
Code:
#!/usr/bin/python3
from DistUpgrade.DistUpgradeMain import main
import sys
if __name__ == "__main__":
sys.exit(main())
that refers to python3 which is linked to python3.5
Code:
# ls -ld /usr/bin/python3
lrwxrwxrwx 1 root root 9 Mar 23 2016 /usr/bin/python3 -> python3.5
On the other hand you can use different versions of python in your work without tempering with the system's . But update-alternatives is NOT the way to do it because many system components are compiled based on the version that comes with the system, and by changing the default via update alternatives again you break your system (
that is probably what caused your issue in the first place)
The default has not been changed on purpose.
There are many ways to use different versions of python safely, e.g anaconda or virtualenv. I compiled python3.7 in my $HOME from source and invoke it with a script that sets all the environmental variables (Ubuntu 16.04), --I prefer it to Anaconda because the latter installs other stuffs I don't need, but Anaconda is a lot easier to setup if you are not very experienced, --but I don't remove the system's python3.5, nor do I try to override it with update-alternatives.
I haven't done any of that.
Bookmarks