Reputation: 42957
I am trying to start a Python project on my Ubuntu 20.04 machine and I have the following doubt. It seems to me that I have multiple Python version installed on my machine.
Into the /usr/lib/ directory I have the following subdirectories:
Ok the firest one referers to the old legacy Python 2 version but why I am finding 3 different Python 3 versions?
If I perform the command:
andrea@ubuntu:/usr/lib$ python3 --version
Python 3.8.5
I obtain that the used one related to the python3 command is the 3.8.5
So I have the following doubts:
is it refered to my python3/ folder or to my python3.8/ folder? Where is defined the association of the python3 command to the effective Python version used?
What can I do to have a clean situation where I only have the Python2.7 and one of these Python3 version?
Upvotes: 3
Views: 1693
Reputation: 2452
The reason you have different versions of python installed on your machine is because either other software you have installed on your machine depend on different version of python, or you've installed the different versions your self.
You can try to uninstall a specific version of python using your package manger, i.e. apt remove
On Debian based systems (and Ubuntu is based on Debian) the update-alternatives
command/system is used to determine the default version/application the system will use for various component. So for example you can use update-alternatives to set the default system editor and the default python version.
Upvotes: 3