How do i remove python 2.7 from linux?
This is what I have after doing purge of all the python versions and reinstalling only 3.6.
Also the pip and pip3 commands are totally f up:
I am totally noob at Linux, I just wanted to update Python from 2.x to 3.x so that Platformio could upgrade and now I messed up everything it seems.
I have successfully installed python 3.3 on Ubuntu 12.10. Since I don’t need multiple versions of python, I want to remove the existing python 2.7. When I try to do that, using
Ubuntu warns me that there are tons of system dependent components which will also be removed. It looks really scary.
So, is there a way to remove python 2.7 without removing the system dependent components, or can I direct those dependents to use python 3.3?
1,8801 gold badge18 silver badges39 bronze badges
asked Jul 1, 2013 at 13:42
From the Ubuntu wiki / Python:
This means that a lot of base packages have hard dependencies on 2.7 and it will still take a lot of time tot get things migrated. Note that Python 3 has numerous backwards incompatible changes -- it's not a regular package upgrade.
If you really want to get rid of Python 2.7, you'll have to wait for the 14.04 release, but there's no guarantee.
7332 gold badges8 silver badges19 bronze badges
answered Jul 1, 2013 at 13:49
65.4k31 gold badges182 silver badges279 bronze badges
Came here in 2019 because I develop in Python3 by default and came to the same conclusion as OP after seeing what'd be removed after running
Since what I really wanted was to call Python3 with just
This way, if Python2.7 is still needed, it can be
called explicitly with
I don't have any bash level scripts that call python2.7 with
- The "python" Command On Unix-Like Systems
This answer isn't a direct response to OP, but as someone who had a similar question this is the functionality I was looking for when I was thinking of removing 2.7. Rather than delete, just prioritize which one gets to use
answered May 29, 2019 at 21:44
2812 silver badges5 bronze badges
You can't, and you don't really want to.
Python changed drastically between 2.7 and 3.0, and broke backward compatibility. Python scripts that were written for 2.7, which are used to support a large amount of the system's infrastructure, won't necessarily work properly with Python 3.x. Those scripts need to be updated to work with the new version, and until that happens, you'll need to keep Python 2.7 around.
This is why you notice such a large number of dependencies on the old Python - the system depends on it. Besides, there's no harm in having both versions of Python installed on the same system. And you may come across applications in the future that still use Python 2.7, so keeping it around is a good idea.
answered Jul 6, 2013 at 14:32
How do I completely remove Python from Linux?
Navigate to Control Panel. Click “Uninstall a program”, and a list of all the currently installed programs will display. Select the Python version that you want to uninstall, then click the “Uninstall” button above the list – this has to be done for every Python version installed on the system.
How do I uninstall older versions of Python on Linux?
Uninstalling Older Python Versions.
Go to Control Panel and select Add or Remove Programs..
Assuming you have an older version X.Y installed, scroll through the list of programs, and for each Python X.Y package that has been installed, select it in the list and click Remove..
How do I uninstall Python 2.7 from command prompt?
First of all open your Command Prompt. Then run this cd C:\Users\<you name>\AppData\Local\Microsoft\WindowsApps Then del python.exe Then del python3.exe After of this steps you will find completely uninstalled python.
How do I uninstall Python 2.7 from CentOS?
Uninstall Python on CentOS 8 Use DNF to uninstall any Python version. The command uninstalls Python 3 and removes related dependencies. Confirm you want to remove the listed packages by typing y and hit Enter. Again, verify you want to remove the package with y and Enter.