pip - 要求已经满足? [英] pip - Requirement already satisfied?

查看:45
本文介绍了pip - 要求已经满足?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pip 识别全局安装的包..?!:-(

pip recognize global installed packages..?! :-(

我使用了 virtualenvwrapper preactivate hook 来清理 PYTHONPATH,

I've used virtualenvwrapper preactivate hook to clean PYTHONPATH,

export PYTHONPATH="" 

然后 echo $PYTHONPATH 返回空字符串,但这没有帮助.

then echo $PYTHONPATH returns empty string, but this didn't help.

怎么了?

bentzy@lama:~$ mkvirtualenv test
New python executable in test/bin/python
Installing setuptools............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/preactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/postactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/get_env_details
(test)bentzy@lama:~$ which pip
/home/bentzy/.virtualenvs/test/bin/pip
(test)bentzy@lama:~$ sudo pip install simplejson
Requirement already satisfied (use --upgrade to upgrade): simplejson in /usr/lib    /python2.7/dist-packages
Cleaning up...
(test)bentzy@lama:~$ echo $PYTHONPATH

(test)bentzy@lama:~$ pip --version
pip 1.2.1 from /home/bentzy/.virtualenvs/test/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg (python 2.7)

推荐答案

您正在使用 sudo 来安装 simplejson,但是如果您使用 sudo 您的 $PATH 可能会改变,这似乎是问题所在.

You are using sudo to install simplejson, but if you use sudo your $PATH may be changed, and that seems to be the problem.

只需使用 pip install simplejson(不包括 sudo),它可能会起作用.

Just use pip install simplejson (no sudo included) and it is probably going to work.

仅当您想影响整个系统时才使用 sudo.

Use sudo only when you want to affect your whole system.

这篇关于pip - 要求已经满足?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆