简体   繁体   English

什么是“错误:选项 - 单个版本 - 外部管理无法识别”表示什么?

[英]What does “error: option --single-version-externally-managed not recognized” indicate?

I seem to have suddenly started encounter the error error: option --single-version-externally-managed not recognized when pip install ing varions packages (including PyObjC and astropy ). 我似乎突然开始遇到错误error: option --single-version-externally-managed not recognizedpip install varions包(包括PyObjCastropy )时, error: option --single-version-externally-managed not recognized单个error: option --single-version-externally-managed not recognized I've never seen this error before, but it's now also showing up on travis-ci builds for which nothing has changed. 我之前从未见过这个错误,但它现在也出现在travis-ci版本中,没有任何改变。

Does this error indicate an out of date distribute? 此错误是否表示过期分发? Or some incorrectly specified option in setup.py ? 或者在setup.py有一些错误指定的选项? Or something else entirely? 或完全不同的东西?

Add --egg option 添加--egg选项

pip install --egg SCons

I use pip version 1.4.1 我使用pip版本1.4.1

New Update: 新更新:

Install the latest version of setuptools . 安装最新版本的setuptools If you still get the error, install wheel as well. 如果仍然出现错误,请同时安装wheel

pip install -U setuptools
pip install -U wheel

Original Answer / More Details: 原始答案/更多详情:

--single-version-externally-managed is an option used for Python packages instructing the setuptools module to create a Python package which can be easily managed by the host's package manager if needed, like Yum or Apt. --single-version-externally-managed是一个用于Python包的选项,指示setuptools模块创建一个Python包,如果需要,可以由主机的包管理器轻松管理,如Yum或Apt。

If you're seeing this message, you may have an old version of setuptools or Python. 如果您看到此消息,则可能有旧版本的setuptools或Python。 Try using Distribute, which is a newer version of setuptools and is backwards compatible. 尝试使用Distribute,这是一个较新版本的setuptools,并且向后兼容。 These packages may expect that you have it already. 这些包可能会让您拥有它。

https://pypi.python.org/pypi/distribute https://pypi.python.org/pypi/distribute

Edit: At this point, distribute has been merged into the main setuptools project. 编辑:此时,分发已合并到主setuptools项目中。 Just install the latest version of setuptools . 只需安装最新版本的setuptools As @wynemo indicated, you may wish to use the --egg option instead, as it's more appropriate for those doing manual installations where you're not intending to create a system package for distribution. 正如@wynemo指出的那样,您可能希望使用--egg选项,因为它更适合那些您不打算创建系统包以进行分发的手动安装。

安装wheel解决了这个问题与最近的pip (我使用8.1.2):

pip install wheel

尝试升级setuptools,如下所示:

pip install --upgrade setuptools

I was having this problem. 我遇到了这个问题。 It turned out it was a problem with the file permissions on my pip cache. 事实证明,我的pip缓存上的文件权限存在问题。

If you see a message at the very beginning of your pip output like 如果你在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.

you might have the same problem. 你可能有同样的问题。 You can resolve it by either ensuring that you have proper file permissions on your pip cache (something like chown -R $(whoami) /home/ubuntu/.cache/pip ) or, if you're on a UNIX, you can set the pip cache location with the XDG_CACHE_HOME env var to some folder you do own. 您可以通过确保您的pip缓存具有适当的文件权限(如chown -R $(whoami) /home/ubuntu/.cache/pip )来解决它,或者,如果您在UNIX上,则可以设置使用XDG_CACHE_HOME env var的pip缓存位置到您拥有的某个文件夹。

I think I have the latest version of everything and I can't install 3.7.1 or 3.5.3 in my debian 9 system with pip3. 我想我有最新版本的一切,我不能在我的debian 9系统中用pip3安装3.7.1或3.5.3。
Using the --egg option is a non-starter: $ sudo pip3 --egg install /home/dick/PY/Python-3.7.1.tgz 使用--egg选项是非启动的:$ sudo pip3 --egg install /home/dick/PY/Python-3.7.1.tgz

Usage: 用法:
pip [options] no such option: --egg pip [options]没有这样的选择: - egg

I have this problem on my macbook also when I try to upgrade one python package. 当我尝试升级一个python包时,我的macbook上也有这个问题。 I check pip version in OS X, it's too old: 1.1. 我检查OS X中的pip版本,它太旧了:1.1。 I use follow cmd to upgrade pip to 1.5.6 我使用follow cmd将pip升级到1.5.6

easy_install -U pip

Then this error is fixed. 然后修复此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM