点子认识全球已安装的软件包..?! :-(
我用virtualenvwrapper预激活钩清理PYTHONPATH,
export PYTHONPATH=""
然后回显$ 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)