Here's the steps (my non-computer-savvy girlfriend had to figure this one out for me, but unlike all the far more complicated processes one can find online, this one works)
- Open Control Panel
- Click "Uninstall a Program"
- Scroll down to Python and click uninstall for each version you don't want anymore.
This works on Windows 7 out of the box, no additional programs or scripts required.
Answer from ArtOfWarfare on Stack OverflowHere's the steps (my non-computer-savvy girlfriend had to figure this one out for me, but unlike all the far more complicated processes one can find online, this one works)
- Open Control Panel
- Click "Uninstall a Program"
- Scroll down to Python and click uninstall for each version you don't want anymore.
This works on Windows 7 out of the box, no additional programs or scripts required.
You will also have to look in your system path. Python puts itself there and does not remove itself: http://www.computerhope.com/issues/ch000549.htm
Your problems probably started because your python path is pointing to the wrong one.
so im on win10 and running python 3.8.3 and my pip suddenly stopped working and couldnt get it to work anymore. i tried lots of things but sadly nothing .
so i would like to completely remove python ( and the cache or whatever will be scattered or left behind by the installer) . anyone can help me on this
Uninstallation command
Need a programmatic method to uninstall python on Windows Server 2022.
Could you pls tell me how to uninstall python 3.12.4(64 bit)
How can i do a FULL uninstall of python?
Videos
You can check to see if there are such specific steps on the Python site. I removed the Python packages with Uninstall-Package and it worked as expected. Try repairing the installation using the Python installer, then run the Uninstall-Package cmdlet again.
Also it seems the packages should be removed in some specific order. I removed the documents and libraries first, and the core interpreter and executables last.
Hi,
What is the UninstallString? Have you checked the msi.log file for details?
See if you can uninstall the MSI using msiexec.exe
MsiExec.exe /x /quiet
Solution:
UNHIDE ALL FOLDERS BEFORE FOLLOWING DOWN...
- Go to C:\Users\%USERNAME%\AppData\Local\Programs
- Delete Python Folder
- Go to Control Panel >> Uninstall a Program
- Right Click on Python and then Change/Modify
- Click on Repair Python. Note: This may or may not fail, but be patient
- Now Again go to step 3
- Now, after step 3, uninstall Python
Now you should be able to install a new fresh version.
It's also possible to execute the python3 installer again, you get option to repair or uninstall. Just choose uninstall, it will be done properly.
First, There should be no problem in removing the service with sc.
Also, Check in the add remove programs. Most packages that install in this way put entry in the add/remove programs in control panel.
Run the python.exe setup.py --help and see the output. or even just python.exe setup.py without any parameters. Most packeges will print uninstall information.
Have a look inside setup.py, there might be a listing of verbs, one of which can be "uninstall" or "remove"
python code is extremely easy to read
Dear u/daddy_spez,
I am going to reinstall python but there are things the uninstaller just doesn't remove.
The pip packages are there, the PATH is there, some leftover files are still there and who know what else is in the system.
I want to fully uninstall python so i can reinstall it and all the packages i got, if i re-install while all these things are still there it will create conflicts and things that once worked will be bugged.
Please don't.
Ubuntu relies heavily on different Python versions for functionality. New releases of Ubuntu are slowly shifting to Python3, but older versions of Python are still in use.
You can list some important Ubuntu and Gnome packages on your system that depend on Python3, for example, like so:
apt-cache rdepends -i --installed --recurse python3 | \
grep -v " " | sort -u | grep -E "ubuntu|gnome"
On Ubuntu 20.10 desktop, these important packages are among them:
gnome-control-center
gnome-session
gnome-terminal
network-manager-gnome
ubuntu-desktop
ubuntu-desktop-minimal
ubuntu-drivers-common
ubuntu-minimal
ubuntu-release-upgrader-core
ubuntu-release-upgrader-gtk
ubuntu-session
ubuntu-standard
ubuntu-system-service
Moreover, there is no such Python clean state. Each system update and each package you install might bring with it Python related dependencies.
You can however use pip or pip3 to uninstall only packages you previously manually installed and even this is not totally risk free.
If you have already removed Python, try this or this if you need a fix. Chances are little though. If you manage to fix it, you are lucky.
Golden rule... Leave the snake alone.
That being said, use a Python virtual environment for your Python projects and you shouldn't be needing to clean or go back to clean state Ubuntu system Python.
Python virtual environments create an isolated environment for your Python projects. This means that each project can have its own dependencies, regardless of what dependencies the Ubuntu system or other Python projects have.
This feature can be installed for Python3 like so:
sudo apt install python3-venv
To make a Python3 virtual environment for a project, you would first create a directory and cd to it like so:
mkdir my_env && cd my_env
Then, create a new Python3 virtual environment inside the directory like so:
python3 -m venv env
This will create a structure like this:
$tree -L 3
.
βββ env
βββ bin
β βββ activate
β βββ activate.csh
β βββ activate.fish
β βββ Activate.ps1
β βββ easy_install
β βββ easy_install-3.8
β βββ pip
β βββ pip3
β βββ pip3.8
β βββ python -> python3
β βββ python3 -> /usr/bin/python3
βββ include
βββ lib
β βββ python3.8
βββ lib64 -> lib
βββ pyvenv.cfg
βββ share
βββ python-wheels
To use this environment, activate it like so:
source env/bin/activate
Your shell prompt will show (env) like so:
(env) $
During this, Python3 commands, module installs or modifications will be contained locally in this virtual environment.
When you are done, deactivate this Python3 virtual environment like so:
deactivate
You are now back to the system-wide Python3 and commands will take effect globally so be careful.
Here's a method:
get 'apt-cache' to show reverse-dependencies, recursively, of the core python library; "--installed" to limit to packages installed, and "-i" to show only important dependencies (i.e. not suggests or recommends).
The 'grep' filters out all except package names, then sorted uniquely (there'll be many duplicates), then use 'xargs' to append the resulting list of lines as parameters to 'apt-mark auto', which marks them as automatically installed.
'Automatically installed' packages will be removed by 'apt autoremove' when no more packages depend on them.
apt-cache --installed -i --recurse rdepends \
libpython3.8-minimal | \
grep "^ " | sort -u | \
xargs apt-mark auto
apt autoremove
This will show the long list of packages to be removed, be careful of unexpected dependencies removing packages you want to keep!
Say 'no' to that prompt and 'apt-mark manual ThisOne' for all the packages you need to keep, and run 'apt autoremove' again (and check again!) to get rid of the junk.