如何卸载 Python 和所有软件包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42324425/
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
How to uninstall Python and all packages
提问by Senyokbalgul
I wish to uninstall Python 2.7 and all packages connected to it. I initially installed Python from the official website and I installed all packages using the pip install command. Would uninstalling Python from the control panel also uninstall all packages automatically?
我想卸载 Python 2.7 和所有连接到它的包。我最初从官方网站安装了 Python,然后使用 pip install 命令安装了所有软件包。从控制面板卸载 Python 也会自动卸载所有软件包吗?
The reason I want to uninstall Python is because I want to use Anaconda in order to be able to manage packages more easily and also be able to install both Python 2 and 3 to switch between them back and forth.
我想卸载 Python 的原因是因为我想使用 Anaconda 以便能够更轻松地管理包,并且还能够安装 Python 2 和 3 以在它们之间来回切换。
回答by Nick Hale
If you uninstall from the control panel, it should remove all packages with it. To ensure that your path doesn't contain your old python when you try and use anaconda, you should remove Python from your path. In windows 10:
如果您从控制面板卸载,它应该删除所有软件包。为确保在尝试使用 anaconda 时您的路径不包含旧的 Python,您应该从路径中删除 Python。在 Windows 10 中:
- From desktop go bottom left and find the menu.
- Click system, then Advanced System Settings
- In this window, go to the Advanced tab and click on the environment variables button.
- From there you can edit your Path, with the edit button.
- Make sure there is no reference to Python here. Also, all variables are separated by a ; so make sure all syntax is good before saving.
- Install anaconda and at the end of the install it should ask if you want to make it the default Python. Say yes and every time you or another program asks for Python, it will get pointed to anaconda.
- 从桌面转到左下角并找到菜单。
- 单击系统,然后单击高级系统设置
- 在此窗口中,转到“高级”选项卡并单击“环境变量”按钮。
- 从那里您可以使用编辑按钮编辑您的路径。
- 确保这里没有对 Python 的引用。此外,所有变量都用 ; 分隔。所以在保存之前确保所有语法都正确。
- 安装 anaconda 并在安装结束时询问您是否要将其设为默认 Python。说是,每次您或其他程序要求 Python 时,它都会指向 anaconda。