从 Windows 7 完全卸载 Python 2.7 的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15828294/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Problems in fully uninstalling Python 2.7 from Windows 7
提问by MrWonka984
some months ago, I installed Python 2.7 on my laptop (my os is Windows 7). After, I decided to use Python xy 2.7.3 instead of 'pure' Python; so, as suggested, I removed Python 2.7 and tried to install Python xy 2.7.3. However, when I tried to run the .exe file for installation, a warning window appears telling me that Python 2.7 is already installed on my computer. I tried to install a different version of Python xy (2.6) and everything went fine; however, I'd really prefer to use the latest version of Python xy. Actually, I can't figure out what went wrong whie uninstalling Python 2.7; does someone have any clue? I can tell you that I followed the 'normal' procedure for programm uninstalltion; control panel -> Programs -> Remove Program
几个月前,我在笔记本电脑上安装了 Python 2.7(我的操作系统是 Windows 7)。之后,我决定使用 Python xy 2.7.3 而不是“纯”Python;因此,按照建议,我删除了 Python 2.7 并尝试安装 Python xy 2.7.3。但是,当我尝试运行 .exe 文件进行安装时,会出现一个警告窗口,告诉我我的计算机上已经安装了 Python 2.7。我尝试安装不同版本的 Python xy (2.6),一切正常;但是,我真的更喜欢使用最新版本的 Python xy。实际上,我无法弄清楚卸载 Python 2.7 时出了什么问题;有人有任何线索吗?我可以告诉你,我按照“正常”程序卸载程序;控制面板 -> 程序 -> 删除程序
Thanks in advance
提前致谢
Stefano
斯特凡诺
回答by SaCry
Maybe to put an answer out there.
也许把答案放在那里。
Uninstalling anything from windows can have multiple side effects residing completly on your specific machine. As to what is common:
从 Windows 卸载任何东西都会有多种副作用,这些副作用完全存在于您的特定机器上。至于常见的:
-> Python sets itself in your windows path. Here is how to modify your windows path: http://www.computerhope.com/issues/ch000549.htmIt means that there is a probability that python is gone but the path entry might not be. That is a guess however -> more information needed
-> Python 将自己设置在您的 Windows 路径中。以下是如何修改您的 Windows 路径:http://www.computerhope.com/issues/ch000549.htm这意味着 python 有可能消失,但路径条目可能没有。然而,这是一个猜测 -> 需要更多信息
-> Are you sure that everything was removed from your computer? If you already did the normal uninstalling process - try to look up if any python directory is still present.
-> 你确定所有东西都从你的电脑上删除了吗?如果您已经完成了正常的卸载过程 - 尝试查找是否仍然存在任何 python 目录。
-> Thirdparty installed? Have you downloaded any libs that are still on your machine.
-> 第三方安装?您是否下载了仍在您机器上的任何库。
Besides from that - it could be anything - the more information you give us the more we can say about it.
除此之外——它可以是任何东西——你给我们的信息越多,我们就越能谈论它。
Maybe this post will help you: How to completely remove Python from a Windows machine?
也许这篇文章会对您有所帮助:如何从 Windows 机器中完全删除 Python?
回答by rshield
I also had this issue as well. It was due to third party installs. Even though you have uninstalled python, it leaves all the third party libraries that were installed and I think Python(x,y) just detects the directory.
我也有这个问题。这是由于第三方安装。即使您已经卸载了 python,它也会留下所有已安装的第三方库,我认为 Python(x,y) 只会检测到该目录。
To fix, uninstall Python 2.7 and then check to see if C:\Python27 still exists. If it does, go ahead and delete and then try installing Python(x,y). That is what worked for me.
要修复,请卸载 Python 2.7,然后检查 C:\Python27 是否仍然存在。如果是,请继续删除,然后尝试安装 Python(x,y)。这对我有用。
回答by Daniel
Run regedit, backup and delete the registry keys:
运行 regedit,备份并删除注册表项:
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_LOCAL_MACHINE\软件\Python\
HKEY_CURRENT_USER\Software\Python
HKEY_CURRENT_USER\Software\Python
My problem occurred when changing from Canopy to Python(x,y). So, also delete all folders that are left behind when uninstalling. https://support.enthought.com/entries/23580651-Uninstalling-Canopy
从 Canopy 更改为 Python(x,y) 时出现了我的问题。因此,还要删除卸载时留下的所有文件夹。 https://support.enthought.com/entries/23580651-Uninstalling-Canopy
回答by OpticsGuy
I had python 2.7 installed and enthought canopy. I wanted to switch to python(x,y) to access a full version of the OpenCV library. python(x,y) installation complained about python 2.7 already being installed after: 1)Using windows control panel 2)Removing all lingering python files 3)Removing the windows path as suggested above
我安装了python 2.7并考虑了canopy。我想切换到 python(x,y) 来访问完整版本的 OpenCV 库。python(x,y) 安装抱怨 python 2.7 已经被安装: 1) 使用 Windows 控制面板 2) 删除所有遗留的 python 文件 3) 删除 Windows 路径如上建议
Not until I removed all registry entries related to python/enthough did python(x,y) install without issue.
直到我删除了与 python/enthough 相关的所有注册表项,python(x,y) 安装才没有问题。
回答by Pavan Gowda
I faced this issue:
I tried to uninstall the python and fresh install, reason my pip version issue was not getting resolved.
So I deleted the python folder, removed python from system path, and when I tried to uninstall from "Uninstall a program" in control panel, it showed "Windows installation package" error window and could not clean uninstall.
Solution what i found was: In the "Uninstall a program" select python and click repair. And then uninstall the python, it worked for me. Hope this helps and save some time.
PS: I am pretty new to python, and any help correcting me would be appreciated.
我遇到了这个问题:
我试图卸载 python 并进行全新安装,原因是我的 pip 版本问题没有得到解决。
所以我删除了python文件夹,从系统路径中删除了python,当我尝试从控制面板中的“卸载程序”中卸载时,它显示“Windows安装包”错误窗口并且无法完全卸载。
我发现的解决方案是:在“卸载程序”中选择 python 并单击修复。然后卸载python,它对我有用。希望这会有所帮助并节省一些时间。
PS:我对 python 很陌生,任何纠正我的帮助将不胜感激。
回答by cormacanderson
I had python 2.7.12 and wanted to uninstall it for 2.7.9. I had the same problem as you and to fix it I tried to delete all of the local files and then uninstall however it still gave me the same error. So instead I decided to repair the python 2.7.12 and then uninstall which worked perfectly and completely got rid of the error.
我有 python 2.7.12 并想为 2.7.9 卸载它。我和你有同样的问题并修复它我试图删除所有本地文件然后卸载但它仍然给我同样的错误。因此,我决定修复 python 2.7.12,然后卸载它,它工作得很好,完全摆脱了错误。
回答by Mode
I installed Enthought before. When I wanted to install Python(x,y) instead, I met the problems above.
我之前安装了Enthought。当我想安装 Python(x,y) 时,我遇到了上述问题。
After I had tried to uninstall Enthought and Python(x,y) from the Control Panel and then restart the PC, the problem still occured the next time I installed Python(x,y).
在我尝试从控制面板卸载 Enthought 和 Python(x,y) 然后重新启动 PC 后,下次安装 Python(x,y) 时仍然出现问题。
I solved this problem by:
我通过以下方式解决了这个问题:
- deleting all the relevant files in C:/User/UserName/AppData/ about Python, including the third party softwares like Enthought;
- deleting the Path in user and system Environment; =====the two steps were failed if I didn't do the third step.=====
- deleting the register keys as @Daniel said. (include all the relevant keys with the prefix py if you installed the third party software about Python. )
- 删除C:/User/UserName/AppData/中关于Python的所有相关文件,包括Enthought等第三方软件;
- 删除用户和系统环境中的Path;======如果我不做第三步,两步都失败了。=====
- 正如@Daniel 所说,删除注册键。(如果您安装了有关 Python 的第三方软件,请将所有相关的键包含在前缀 py 中。)
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_LOCAL_MACHINE\软件\Python\
HKEY_CURRENT_USER\Software\Python
HKEY_CURRENT_USER\Software\Python
回答by Sudhanshu
Locate that set up file which was used to install Python. Run it and choose repair. If that doesn't solve the problem. Go to c:\Python(x,y) and delete this folder completely by shift+Del.
找到用于安装 Python 的设置文件。运行它并选择修复。如果这样还不能解决问题。转到 c:\Python(x,y) 并通过 shift+Del 完全删除此文件夹。
Run that set up file again and click on "Change" which will ultimately install the Python again. By default in my case option to add path and making that version of Python the default on my system was unchecked which can be figured out by seeing the red cross mark in one of the installation screen. Click on it if you want set up to make it default Python version and also click on the option to indicate you want the path to be added in windows environment variable.
再次运行该设置文件并单击“更改”,最终将再次安装 Python。默认情况下,在我的情况下,添加路径和使该版本的 Python 成为我系统上的默认选项的选项未被选中,这可以通过查看安装屏幕之一中的红色叉号来确定。如果要设置为默认 Python 版本,请单击它,并单击该选项以指示您希望将路径添加到 Windows 环境变量中。
No need to touch registry as previous ones will be overwritten again. In my case it worked. I was getting error like:
无需触摸注册表,因为以前的将再次被覆盖。就我而言,它起作用了。我收到如下错误:
Fatal Python error: Py_Initialize: unable to load the file system codec LookupError: no codec search functions registered: can't find encoding
致命的 Python 错误:Py_Initialize:无法加载文件系统编解码器 LookupError:未注册编解码器搜索功能:找不到编码
Besides that un-installation was failing from control panel. So above steps solved all of my problem. Hope it helps.
此外,从控制面板卸载失败。所以以上步骤解决了我所有的问题。希望能帮助到你。
回答by Vedha Peri
- I Repaired/Modified to install all the components for the Python version I wanted to uninstall.
- Once that was done, I clicked on Uninstall/Change and that uninstalled it for good.
- 我修复/修改以安装我想卸载的 Python 版本的所有组件。
- 完成后,我单击“卸载/更改”并永久卸载它。

