How to cleanly remove pip that is installed by using easy_install?

我怕爱的太早我们不能终老 提交于 2019-12-03 17:02:45

问题


If I used sudo easy_install pip on my OS X Lion 10.7.4, how do I cleanly remove it? After the installation, I also did pip install --upgrade setuptools

Here is the output:

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

The pip (installed by easy_install) is causing symlink problems when I do brew install python, which will install its own pip to /usr/local/bin as:

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 

I know I can just use brew link --overwrite python but I don't like the pip installed by easy_install to be in my system if I don't use it. I prefer to keep my system clean.

Can someone also explain to me what those warnings are for? I know they do no harm but I am curious if I am missing any dependency?

Thanks.


回答1:


Use pip to uninstall pip:

sudo pip uninstall pip



回答2:


From this link:

easy_install -mxN <PackageName>

That means, execute:

easy_install -mxN pip

Then, you can manually remove the .egg files or directories, which should be somewhere in .../Python/2.7/site-packages/[PACKAGE].egg.

But I didn't try that. I even don't use the Mac :)

You can see also similar question: How do I remove packages installed with Python's easy_install?



来源:https://stackoverflow.com/questions/22247889/how-to-cleanly-remove-pip-that-is-installed-by-using-easy-install

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!