pip認可全球安裝軟件包..?! :-(pip - 要求已滿足?
我用virtualenvwrapper預激活鉤清理PYTHONPATH,
export PYTHONPATH=""
然後回顯$ PYTHONPATH返回空字符串,但這並沒有幫助。
怎麼了?
[email protected]:~$ 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)[email protected]:~$ which pip
/home/bentzy/.virtualenvs/test/bin/pip
(test)[email protected]:~$ sudo pip install simplejson
Requirement already satisfied (use --upgrade to upgrade): simplejson in /usr/lib /python2.7/dist-packages
Cleaning up...
(test)[email protected]:~$ echo $PYTHONPATH
(test)[email protected]:~$ 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)
我沒有用過virtualenvwrapper,但我的virtualenv使用--no-site-packages中選擇。 mkvirtualenv可以通過這個選項嗎? –
是的 - 但這不是問題。從virtualenv 1.7開始,--no-site-packages已成爲默認值,並且已被棄用。我使用1.8.2。 無論如何 - 我也試過了,仍然沒有像預期的那樣工作...... – bentzy
嘗試打印'sys.path'並看看裏面有什麼。 – Aman