Can i have only one python version if multiple version of python is installed on my system

i have three python version installed on zorin os 16 which are as follows

python 3.9.5 64 bit

python 3.8.10 64 bit

python 2.7.18 64 bit

due to multiple version of python im having problem while coding so i want to know that can i delete python version 2.7.18 and python version 3.8.10 and only keep python version 3.9.5

1 Like

Sadly, no... There are libraries that depend on those versions present in the system. Removing them could cause crashes or even kernel panic.
Once done, it is not so easy to undo, either. @337harvey experienced this first-hand...

1 Like

You can set up alternatives to ensure the 3.8 version is used for the system, then create aliases in the .bashrc file to point to the 3.9 version when you call python or python3. The same can be done for pip3. You can also specify which version the IDE uses.

In this way you ensure the system uses the python version it requires and you can add and code in another.

1 Like

Nice question brother @AdityaKirad even I'm also has this doubt. Finally I got an answer thank you @Aravisian and @337harvey .

Marked solution. 170