【问题标题】:How to cleanly remove pip that is installed by using easy_install?如何干净地删除使用 easy_install 安装的 pip?
【发布时间】:2014-04-10 11:17:22
【问题描述】:

如果我在 OS X Lion 10.7.4 上使用了sudo easy_install pip,如何彻底删除它? 安装后,我也做了 pip install --upgrade setuptools

这是输出:

mac:~ usr$ sudo easy_install pip 
Password:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Best match: pip 1.5.4   
Downloading https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb
Processing pip-1.5.4.tar.gz
Running pip-1.5.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-b_hfrF/pip-1.5.4/egg-dist-tmp-o0r8F5
warning: no files found matching 'pip/cacert.pem' 
warning: no files found matching '*.html' under directory 'docs' 
warning: no previously-included files matching '*.rst' found under directory 'docs/_build' 
no previously-included directories found matching 'docs/_build/_sources' 
Adding pip 1.5.4 to easy-install.pth file   
Installing pip script to /usr/local/bin     
Installing pip2.7 script to /usr/local/bin  
Installing pip2 script to /usr/local/bin    

Installed /Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg 
Processing dependencies for pip
Finished processing dependencies for pip

当我执行brew install python 时,pip(由 easy_install 安装)导致符号链接问题,它将自己的 pip 安装到 /usr/local/bin 为:

lrwxr-xr-x  1 usr  admin   30  3  3 23:26 pip -> ../Cellar/python/2.7.6/bin/pip 
lrwxr-xr-x  1 usr  admin   31  3  3 23:26 pip2 -> ../Cellar/python/2.7.6/bin/pip2 
lrwxr-xr-x  1 usr  admin   33  3  3 23:26 pip2.7 -> ../Cellar/python/2.7.6/bin/pip2.7 

我知道我可以只使用brew link --overwrite python,但如果我不使用它,我不喜欢easy_install 安装的pip 在我的系统中。我更喜欢保持系统清洁。

有人也可以向我解释这些警告的用途吗?我知道它们没有害处,但我很好奇我是否缺少任何依赖项?

谢谢。

【问题讨论】:

    标签: pip easy-install


    【解决方案1】:

    来自this link

    easy_install -mxN <PackageName>
    

    也就是说,执行:

    easy_install -mxN pip
    

    然后,您可以手动删除 .egg 文件或目录,它们应该位于 .../Python/2.7/site-packages/[PACKAGE].egg 的某个位置。

    你也检查了类似的问题How do I remove packages installed with Python's easy_install?

    【讨论】:

      【解决方案2】:

      使用pip卸载pip:

      sudo pip uninstall pip
      

      【讨论】:

      • - 提供要删除的文件列表,然后是确认提示。这很好。
      猜你喜欢
      • 1970-01-01
      • 2014-12-04
      • 2012-09-23
      • 2014-03-29
      • 1970-01-01
      • 2010-11-16
      • 2018-10-30
      • 1970-01-01
      相关资源
      最近更新 更多