I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena...
I would like to comple开发者_如何学JAVAtely remove Python from my system.
I tried running the 2.7 and 2.6 msi files and choosing remove Python and then running only 2.6 and reinstalling it. Still stuff don't work.How do I completely remove Python - from everything? (!)
I would not like to reinstall my entire machine just because of the Python install...
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.
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.
you can delete it manually.
- open Command Prompt
cd C:\Users\<you name>\AppData\Local\Microsoft\WindowsApps
del python.exe
del python3.exe
Now the command prompt won't be showing it anymore
where python
--> yields nothing, and you are free to install another version from source / anaconda and (after adding its address to Environment Variables -> Path) you will find that very python you just installed
Run ASSOC and FTYPE to see what your py files are associated to. (These commands are internal to cmd.exe so if you use a different command processor ymmv.)
C:> assoc .py
.py=Python.File
C:> ftype Python.File
Python.File="C:\Python26.w64\python.exe" "%1" %*
C:> assoc .pyw
.pyw=Python.NoConFile
C:> ftype Python.NoConFile
Python.NoConFile="C:\Python26.w64\pythonw.exe" "%1" %*
(I have both 32- and 64-bit installs of Python, hence my local directory name.)
I had window 7 (64 bit) and Python 2.7.12,
I uninstalled it by clicking the python installer from the "download" directory then I selected remove python then I clicked “ finish”.
I also removed the remaining python associated directory & files from the c: drive and also from “my documents” folder, since I created some files there.
Open CMD
To show all packages installed -
pip list
To copy the packages name to a file -
pip freeze > requirements.txt
To delete all packages -
pip uninstall -r requirements.txt -y
Check all packages are removed -
pip list
Uninstall pip and other remaining packages
Control panel > Uninstall > Python uninstall (from UI)
It's actually quite simple. When you installed it, you must have done it using some .exe file (I am assuming). Just run that .exe again, and then there will be options to modify Python. Just select the "Complete Uninstall" option, and the EXE will completely wipe out python for you.
Also, you might have to checkbox the "Remove Python from PATH". By default it is selected, but you may as well check it to be sure :)
Uninstall the python program using the windows GUI.
Delete the containing folder e.g if it was stored in C:\python36\
make sure to delete that folder
If you still have the python installer on your PC, you can double-click on it (run it, it will open the installer window), and select the "Uninstall" option. It will uninstall that python version (if the installer is for Python3.9, then Python3.9 will be uninstalled, if it is for Python3.10, then that version...)
First, uninstall Python, then remove the pip packages you installed.
- Uninstall Python:
"Add or Remove Programs"
, search for Python and uninstall it. - Remove Pip packages: type in File Explorer
%LOCALAPPDATA%\Programs\Python
, and remove the folders you want.
This will clean up any pip package you installed. Otherwise, if you were to reinstall Python, you will find yourself with the same pip packages that you had.
I know it is an old question, but I ran into this problem with 2.7 and 3.5. Though 2.7 would not show up in my default windows uninstall list, it showed up fine in the ccleaner tools tab under uninstall. Uninstalled and reinstalled afterwards and it has been smooth coding ever since.
Almost all of the python files should live in their respective folders (C:\Python26
and C:\Python27
). Some installers (ActiveState) will also associate .py*
files and add the python path to %PATH%
with an install if you tick the "use this as the default installation" box.
Windows 7 64-bit, with both Python3.4 and Python2.7 installed at some point :)
I'm using Py.exe to route to Py2 or Py3 depending on the script's needs - but I previously improperly uninstalled Python27 before.
Py27 was removed manually from C:\python\Python27 (the folder Python27 was deleted by me previously)
Upon re-installing Python27, it gave the above error you specify.
It would always back out while trying to 'remove shortcuts' during the installation process.
I placed a copy of Python27 back in that original folder, at C:\Python\Python27, and re-ran the same failing Python27 installer. It was happy locating those items and removing them, and proceeded with the install.
This is not the answer that addresses registry key issues (others mention that) but it is somewhat of a workaround if you know of previous installations that were improperly removed.
You could have some insight to this by opening "regedit" and searching for "Python27" - a registry key appeared in my command-shell Cache pointing at c:\python\python27\ (which had been removed and was not present when searching in the registry upon finding it).
That may help point to previously improperly removed installations.
Good luck!
Windows Start Menu > Settings > Apps > Apps & features > Select the app and click the Uninstall button
精彩评论