点 - 要求已经满足?

ben*_*tzy 9 pip virtualenv virtualenvwrapper

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

我用virtualenvwrapper preactivate钩来清洁PYTHONPATH,

export PYTHONPATH="" 
Run Code Online (Sandbox Code Playgroud)

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

怎么了?

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)
Run Code Online (Sandbox Code Playgroud)

Hug*_*res 16

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

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

使用sudo只有当你想影响你的整个系统.


Sha*_*han 8

已经满意意味着您已经安装了“它”。

尝试: pip卸载simplejson

然后: pip install simplejson