[英]How to install virtualenv scripts to /usr/bin
I install virtualenv with command sudo /usr/bin/pip-2.6 install virtualenv
我使用命令sudo /usr/bin/pip-2.6 install virtualenv
And it says 它说
Requirement already satisfied (use --upgrade to upgrade):
virtualenv in /usr/local/lib/python2.6/dist-packages
Cleaning up...
Why pip from /usr/bin looks to /usr/local/lib? 为什么/ usr / bin中的pip看起来是/ usr / local / lib?
I need to install virtualenv scripts directly to /usr/bin, so I write 我需要将virtualenv脚本直接安装到/ usr / bin,所以我写
sudo /usr/bin/pip-2.6 install --install-option="--install-scripts=/usr/bin" virtualenv
But again it responds with 但它再次回应
Requirement already satisfied (use --upgrade to upgrade):
virtualenv in /usr/local/lib/python2.6/dist-packages
Cleaning up...
Adding --upgrade doesn't help. 添加--upgrade没有帮助。
How can I install virtualenv scripts to /usr/bin ? 如何将virtualenv脚本安装到/ usr / bin?
For your current issue can you first uninstall virtualenv using pip, and then reinstall using --script-dir=DIR, -s DIR
as an --install-option
. 对于当前问题,您可以先使用pip卸载virtualenv,然后使用--script-dir=DIR, -s DIR
作为--install-option
重新--install-option
。
As for your issue running pip
with extra arguments and install not seeming to do anything, that may be fixed on develop
branch at https://github.com/pypa/pip if not please file a bug with us on the GitHub issue tracker for pip. 至于您的问题运行带有额外参数的pip
和安装似乎没有任何作用,可能会在https://github.com/pypa/pip的 develop
分支上进行修复,如果没有,请在GitHub问题跟踪器上向我们提交错误点子
As to why it is behaving like this - the install is based on the python installation not on the location of pip. 至于为什么会这样-安装是基于python安装而不是pip的位置。 Pip uses setuptools/distribute under the hood and conforms to the configuration of the python it is running under. Pip在后台使用setuptools / distribute并符合其下运行的python的配置。
You can see where the version of python you are using installs to by running it - in this case probably python2.6
and querying the sys
module. 您可以通过运行它来查看要使用的python版本安装到的位置-在这种情况下,可能是python2.6
并查询sys
模块。
>>> import sys
>>> sys.prefix
>>> sys.exec_prefix
See also distutils.sysconfig
另请参见distutils.sysconfig
For more information: 欲获得更多信息:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.