如何从Windows机器上彻底删除Python?
我安装了Python 2.7和Python 2.6.5。我不知道出了什么问题,但与 Python 相关的任何东西似乎都不再起作用了。例如,某些软件包的“setup.py install”无法识别“install”参数和其他奇怪的现象...
我想从我的系统中完全删除Python。
我尝试运行 2.7 和 2.6 msi 文件并选择删除 Python,然后仅运行 2.6 并重新安装它。还是东西不起作用。
如何从所有内容中完全删除 Python? (!)
我不想仅仅因为 Python 安装就重新安装我的整个机器......
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 completely 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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(15)
几乎所有 python 文件都应位于各自的文件夹中(
C:\Python26
和C:\Python27
)。如果您勾选“使用此作为默认安装”,某些安装程序 (ActiveState) 还会将.py*
文件关联起来,并将 python 路径添加到%PATH%
中。盒子。Almost all of the python files should live in their respective folders (
C:\Python26
andC:\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位,在某个时候安装了Python3.4和Python2.7:)
我使用Py.exe根据脚本的需要路由到Py2或Py3 - 但我之前不正确地卸载了Python27。
Py27 已从 C:\python\Python27 中手动删除(Python27 文件夹已被我之前删除)。
重新安装 Python27 后,它给出了您指定的上述错误。
在安装过程中尝试“删除快捷方式”时,它总是会退出。
我将 Python27 的副本放回到原始文件夹中(C:\Python\Python27),然后重新运行相同的失败的 Python27 安装程序。它很高兴找到这些项目并删除它们,然后继续安装。
这不是解决注册表项问题的答案(其他人提到过),但如果您知道以前的安装被错误删除,那么这在某种程度上是一种解决方法。
您可以通过打开“regedit”并搜索“Python27”对此有所了解 - 我的命令外壳缓存中出现一个注册表项,指向 c:\python\python27\ (该注册表项已被删除,并且在搜索时不存在)找到它后就进入注册表)。
这可能有助于指出之前未正确删除的安装。
祝你好运!
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 开始菜单 >设置>应用程序>应用程序和特点>>选择应用程序并单击卸载按钮
Windows Start Menu > Settings > Apps > Apps & features > Select the app and click the Uninstall button
安装 IObit 卸载程序它将完全删除 Python。
install IObit uninstaller it will completely remove Python.
以下是步骤(我不懂计算机的女朋友必须为我解决这个问题,但与人们可以在网上找到的所有更复杂的过程不同,这个方法有效)
这可以在 Windows 7 上开箱即用,无需其他程序或脚本。
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)
This works on Windows 7 out of the box, no additional programs or scripts required.
您还必须查看系统路径。 Python 将自身放在那里并且不会删除自身: http://www.computerhope.com/issues/ch000549 .htm
您的问题可能是因为您的 python 路径指向错误的路径而开始的。
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.
您可以手动删除它。
cd C:\Users\\AppData\Local\Microsoft\WindowsApps
del python.exe
del python3.exe
现在命令提示符将不再显示
where python
-->不会产生任何结果,并且您可以自由地从 source / anaconda 安装另一个版本(将其地址添加到环境变量 -> 路径后)您会发现您刚刚安装的 pythonyou can delete it manually.
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运行 ASSOC 和 FTYPE 以查看 py 文件关联的内容。 (这些命令是 cmd.exe 的内部命令,因此如果您使用不同的命令处理器 ymmv。)
(我安装了 32 位和 64 位的 Python,因此是我的本地目录名称。)
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.)
(I have both 32- and 64-bit installs of Python, hence my local directory name.)
打开CMD
显示所有已安装的软件包 -
pip list
将软件包名称复制到文件 -
pip freeze >需求.txt
删除所有包 -
pip uninstall -rrequirements.txt -y
检查所有包是否已删除 -
pip list
卸载 pip 和其他剩余软件包
控制面板>卸载> Python 卸载(从 UI)
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)
首先,卸载 Python,然后删除您安装的 pip 软件包。
“添加或删除程序”
,搜索Python并卸载。%LOCALAPPDATA%\Programs\Python
,然后删除所需的文件夹。这将清理您安装的所有 pip 软件包。否则,如果您要重新安装 Python,您会发现自己拥有与之前相同的 pip 软件包。
First, uninstall Python, then remove the pip packages you installed.
"Add or Remove Programs"
, search for Python and uninstall it.%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.
我有window 7(64位)和Python 2.7.12,
我通过单击“下载”目录中的 python 安装程序来卸载它,然后选择删除 python,然后单击“完成”。
我还删除了剩余的python关联目录&文件来自 c: 驱动器以及“我的文档”文件夹,因为我在那里创建了一些文件。
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.
其实很简单。
当你安装它时,你必须使用一些 .exe 文件来完成它(我假设)。只要再次运行那个.exe,就会出现修改Python的选项。只需选择“完全卸载”选项,EXE 就会为您彻底清除 python。
另外,您可能必须选中“从 PATH 中删除 Python”。默认情况下它是选中的,但您也可以检查一下以确保:)
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 :)
使用 Windows GUI 卸载 python 程序。
删除包含的文件夹,例如,如果它存储在
C:\python36\
中,请确保删除该文件夹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我知道这是一个老问题,但我在 2.7 和 3.5 中遇到了这个问题。虽然 2.7 不会出现在我的默认 Windows 卸载列表中,但它在卸载下的 ccleaner 工具选项卡中显示得很好。之后卸载并重新安装,从此编码顺利。
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.
如果您的电脑上仍然有 python 安装程序,您可以双击它(运行它,它将打开安装程序窗口),然后选择“卸载”选项。它将卸载该Python版本(如果安装程序适用于Python3.9,则将卸载Python3.9,如果适用于Python3.10,则将卸载该版本...)
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...)