简体   繁体   English

如何使用easy_install完全卸载安装的pip?

[英]How to fully uninstall pip installed with easy_install?

On Windows 7, I install pip with easy_install and want to install a lower version of pip. 在Windows 7上,我使用easy_install安装pip,并希望安装较低版本的pip。 I want to remove the old version, but have no idea how to completely remove the pip installed by easy_install (or if there is a way to do it without going through easy_install, that is fine). 我想删除旧版本,但不知道如何完全删除easy_install安装的pip(或者如果有办法在不通过easy_install的情况下执行它,那很好)。 How do I do this? 我该怎么做呢?

There is no completely automatic uninstall but you can do it in two steps: 没有完全自动卸载,但您可以分两步完成:

easy_install -m pip

This should remove pip from easy-install.pth and print the full path to where pip is installed. 这应该从easy-install.pth删除pip并打印到安装pip的完整路径。 Now just manually remove the path that the previous command printed. 现在只需手动删除上一个命令打印的路径。 Or you could just manually edit easy-install.pth and remove the pip sources if you know where they are located. 或者你可以手动编辑easy-install.pth并删除pip源,如果你知道它们的位置。

I found that the following command worked. 我发现以下命令有效。

It deleted the installed files and the .egg directory. 它删除了已安装的文件和.egg目录。 It also provided a confirmation prompt. 它还提供了确认提示。

pip uninstall pip

From this answer . 这个答案

To uninstall pip in windows: 要在Windows中卸载pip:

  • Run command prompt as administrator 以管理员身份运行命令提示
  • Give the command easy_install -m pip 给命令easy_install -m pip
  • This may not uninstall pip completely. 这可能不会完全卸载pip。 So again give this command pip uninstall pip If by previous command pip got uninstalled then this command wont run, else it will completely remove pip 所以再次给这个命令pip uninstall pip如果通过上一个命令pip得到卸载那么这个命令就不会运行了,否则它会完全删除pip
  • Now check by giving command pip --version This should give pip is not recognized as an internal or external command 现在检查给出命令pip --version这应该给pip不被识别为内部或外部命令

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

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