简体   繁体   English

如何从 Web 平台安装程序卸载 python?

[英]How do I uninstall python from web platform installer?

I've installed python and some other packages using web platform installer, but I was having some issues getting a Django project to work so I uninstalled everything and am trying to get it going from scratch.我已经使用 web 平台安装程序安装了 python 和其他一些包,但是我在让 Django 项目工作时遇到了一些问题,所以我卸载了所有东西,并试图从头开始。 Web Platform Installer still shows that I have 'Windows Azure SDK for Python" and "Python 2.7 (32-bit)" installed however and I can't mark them as uninstalled. Web 平台安装程序仍然显示我安装了“Windows Azure SDK for Python”和“Python 2.7(32 位)”,但我无法将它们标记为已卸载。

I don't see where to uninstall from WPI at all, I uninstalled them using control panel.我根本看不到从 WPI 卸载的位置,我使用控制面板卸载了它们。 I think I had originally installed python from the python site and had version 3.3 and 2.7 (64-bit), but now there are no entries containing 'python' when I try to uninstall a program from the control panel.我想我最初从 python 站点安装了 python 并且有 3.3 和 2.7(64 位)版本,但是现在当我尝试从控制面板卸载程序时没有包含“python”的条目。

Does anyone know what is going on or can I download the setups from somewhere and try them manually?有谁知道发生了什么,或者我可以从某个地方下载设置并手动尝试吗? Is there a way to reset what shows as installed in WPI?有没有办法重置 WPI 中安装的显示内容? I tried uninstalling and reinstalling WPI but that didn't help.我尝试卸载并重新安装 WPI,但这没有帮助。

在此处输入图片说明

For what it's worth, I just deleted the folder containing the installed PHP versions(5.3,5.4,5.5), which for me was \\Program Files (x86)\\IIS Express\\PHP.对于它的价值,我只是删除了包含已安装 PHP 版本(5.3、5.4、5.5)的文件夹,对我来说是 \\Program Files (x86)\\IIS Express\\PHP。 Also, I removed "\\Program Files (x86)\\iis express\\php\\5.3" from the search path.另外,我从搜索路径中删除了“\\Program Files (x86)\\iis express\\php\\5.3”。

When I return to the web installer the 'Add' buttons are enabled.当我返回到 Web 安装程序时,“添加”按钮已启用。

I opened the options, set the Web Server to IIS, then installed PHP v5.5.我打开选项,将Web Server 设置为IIS,然后安装PHP v5.5。 It was installed into \\Program Files (x86)\\PHP\\v5.5 and added to the search path.它被安装到 \\Program Files (x86)\\PHP\\v5.5 并添加到搜索路径中。

This is how IIS recommends doing it: IIS 建议这样做:

http://forums.iis.net/t/1178803.aspx http://forums.iis.net/t/1178803.aspx

Open %userprofile%\\documents\\iisexpress\\config\\applicationhost.config file and 1. Find following entry (or similar entry) in applicationhost.config file and comment it or delete it.打开%userprofile%\\documents\\iisexpress\\config\\applicationhost.config文件和 1. 在 applicationhost.config 文件中找到以下条目(或类似条目)并注释或删除它。

  1. Find following entry in hanlders section and comment this as well or delete.在处理程序部分找到以下条目并对此进行评论或删除。

3.By default Web Platform Installer installs PHP to %programfiles%\\iis express\\php\\ . 3.默认情况下,Web 平台安装程序将 PHP 安装到%programfiles%\\iis express\\php\\ so open %programfiles%\\iis express\\php\\ folder and delete the php version folder that you no longer need (don't forget to remove relavant entries from applicationhost.config as mentioned in step 1 and 2 above)所以打开%programfiles%\\iis express\\php\\文件夹并删除您不再需要的 php 版本文件夹(不要忘记从上面的步骤 1 和 2 中提到的 applicationhost.config 中删除相关条目)

Of course you would need to find the python one instead of php but it is the jist of it当然,您需要找到 python 而不是 php,但它就是其中的一部分

I found a PowerShell script in the WPI directory that checked for python installs and I had to delete the registry keys specified in it.我在 WPI 目录中找到了一个 PowerShell 脚本,用于检查 python 安装,我不得不删除其中指定的注册表项。


Let me add some context:让我添加一些上下文:

Open the below path,打开下面的路径,

%LOCALAPPDATA%\Microsoft\Web Platform Installer\installers\PythonDetectInstalls

in the sub-folder of the above path, there is a PowerShell script "DetectPythonInstalls.ps1" which contains two script lines for checking if Python is installed:在上述路径的子文件夹中,有一个PowerShell脚本“DetectPythonInstalls.ps1”,其中包含两个脚本行,用于检查是否安装了Python:

$regKey = "hklm:SOFTWARE\Python\PythonCore\$pythonVersion\InstallPath";
$correctRegKey = "hklm:SOFTWARE\Wow6432Node\Python\PythonCore\$pythonVersion\InstallPath";

Uninstall all Python versions you do not neet.卸载所有不需要的 Python 版本。 However, we need to remove some registry keys manually using "regedit".但是,我们需要使用“regedit”手动删除一些注册表项。

(Safety Note: Please take a backup of the registry keys before removing the above-mentioned registry key) (安全提示:请在删除上述注册表项之前备份注册表项)

Ref: Social.Tecnet参考: Social.Tecnet

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM