kef*_*ich 97 python pip distribute
我似乎突然开始遇到变量包(包括和)error: option --single-version-externally-managed not recognized时的错误.我之前从未见过这个错误,但它现在也出现在travis-ci版本中,没有任何改变.pip installPyObjCastropy
此错误是否表示过期分发?或者一些错误指定的选项setup.py?或完全不同的东西?
wyn*_*emo 136
添加--egg选项
pip install --egg SCons
Run Code Online (Sandbox Code Playgroud)
我使用pip1.4.1版
Kel*_*tek 74
新更新:
安装最新版本setuptools.如果仍然出现错误,请wheel同时安装.
pip install -U setuptools
pip install -U wheel
Run Code Online (Sandbox Code Playgroud)
原始答案/更多详情:
--single-version-externally-managed 是一个用于Python包的选项,指示setuptools模块创建一个Python包,如果需要,可以由主机的包管理器轻松管理,如Yum或Apt.
如果您看到此消息,则可能有旧版本的setuptools或Python.尝试使用Distribute,这是一个较新版本的setuptools,并且向后兼容.这些包可能会让您拥有它.
https://pypi.python.org/pypi/distribute
编辑:此时,分发已合并到主setuptools项目中.只需安装最新版本setuptools.正如@wynemo指出的那样,您可能希望使用该--egg选项,因为它更适合那些您不打算创建系统包以进行分发的手动安装.
Set*_*ley 44
安装wheel解决了这个问题与最近pip(我使用8.1.2):
pip install wheel
Run Code Online (Sandbox Code Playgroud)
我遇到了这个问题.事实证明,我的pip缓存上的文件权限存在问题.
如果你在pip输出的最开头看到一条消息,比如
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Run Code Online (Sandbox Code Playgroud)
你可能有同样的问题.您可以通过确保对pip缓存具有适当的文件权限(例如chown -R $(whoami) /home/ubuntu/.cache/pip)来解决此问题,或者,如果您在UNIX上,则可以使用XDG_CACHE_HOMEenv var 将pip缓存位置设置为您拥有的某个文件夹.