使用Python 2.7.12+(默认值为1)和virtualenv 15.0.3(sudo -H pip install virtualenv
)运行Ubuntu 16.10。我做错了什么?
$ virtualenv a && . "$_"/bin/activate && pip --version
New python executable in /tmp/a/bin/python
Installing setuptools, pip, wheel...done.
pip 9.0.0 from /usr/local/lib/python2.7/dist-packages (python 2.7)
$ /tmp/a/bin/pip --version
pip 9.0.0 from /usr/local/lib/python2.7/dist-packages (python 2.7)
$ /tmp/a/bin/python -c 'from pip import __file__; print __file__'
/usr/local/lib/python2.7/dist-packages/pip/__init__.pyc
答案 0 :(得分:0)
您是否尝试过调用$venv/bin/python $venv/lib/site-packages/pip/__main__.py
?这应该有用。
要找出调用错误点的原因,你应该看看:
$PATH
,它是什么顺序,which pip
和which python
也会有所帮助sys.path
,它是什么顺序,/usr/local/lib/
出现在venv $PYTHONPATH
,影响sys.path