How to uninstall python?

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
noodle7571
New to forums
New to forums
Posts: 2
Joined: Sun Sep 13, 2020 12:20 pm

How to uninstall python?

Post by noodle7571 » Sun Sep 13, 2020 12:23 pm

I need to use python3 but python2.x is still being used after I have installed python3. How would I go about uninstalling python2.x from my ubuntu VPS.

Naleksuh
Compulsive poster
Compulsive poster
Posts: 74
Joined: Thu Jul 25, 2019 12:35 am

Re: How to uninstall python?

Post by Naleksuh » Sun Sep 13, 2020 9:03 pm

What do you mean by "still being used" By the python command? Python 3.x uses the python3 command, so it should not be necessary to uninstall Python 2. However, it can still be removed via the apt purge command (depending on what version of python 2 you had).

noodle7571
New to forums
New to forums
Posts: 2
Joined: Sun Sep 13, 2020 12:20 pm

Re: How to uninstall python?

Post by noodle7571 » Mon Sep 14, 2020 6:32 am

I have python 2.7.17 on the system.

User avatar
Decicus
Compulsive poster
Compulsive poster
Posts: 63
Joined: Thu Dec 05, 2013 1:55 am
Location: Norway
Contact:

Re: How to uninstall python?

Post by Decicus » Tue Sep 15, 2020 12:58 am

Is there anything that prevents you from running

Code: Select all

python3 filename.py
Removing Python 2 probably wouldn't help anyways, as the "python" alias would most likely not point to python3 after removing 2.

Post Reply