【问题标题】:pip: Missing distribution spec. How to fix this?pip:缺少分发规范。如何解决这个问题?
【发布时间】:2015-01-11 01:33:19
【问题描述】:

在我的虚拟机上运行此命令时出现以下错误:

$ sudo pip install -U -v --no-deps -b /tmp/piyush/ /tmp/piyush/common_bundle

  File "/usr/local/lib/python2.7/dist-packages/pip-6.0.6-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 2807, in parse_requirements
    raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '/tmp/piyush/common_bundle')

我的输入文件是一个存档。

$ file common_bundle
common_bundle: Zip archive data, at least v2.0 to extract

pip的版本是:

$ pip -V
pip 6.0.6 from /usr/local/lib/python2.7/dist-packages/pip-6.0.6-py2.7.egg (python 2.7)

这是 common_bundle 中的 pip 清单:

# This is a pip bundle file, that contains many source packages
# that can be installed as a group.  You can install this like:
#     pip this_file.zip
# The rest of the file contains a list of all the packages included:
PyYAML==3.10
boto==2.6.0
msgpack-python==0.2.2
tornado==2.1.1
ujson==1.22
virtualenv==1.8.2
bottle==0.10.7
raven==2.0.3
protobuf==2.4.1
# These packages were installed to satisfy the above requirements:
simplejson==2.4.0
distribute==0.6.32

有什么东西看起来很可疑吗?

谢谢。

【问题讨论】:

  • 捆绑包中的requirements.txt 是否包含格式错误的行?
  • @musically_ut:不。我查看了那个文件,它看起来不错。我还触发了命令“pip install -r file.txt”,它成功通过了。我更新了上面的 pip 清单文件。
  • 你为什么要传递--no-deps?这似乎是破坏安装的好方法......

标签: python pip


【解决方案1】:

pip 从存档安装时,文件必须具有正确的扩展名,或者您需要明确使用file:// 协议。将您的文件重命名为 /tmp/piyush/common_bundle.zip 或使用 file:///tmp/piyush/common_bundle

您看到的错误与存档的内容无关,pip 甚至还没有解压。

【讨论】:

    【解决方案2】:

    检查路径中是否有空格。这是我的问题。也尽量保持文件的路径尽可能短。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-19
      • 2021-06-20
      • 2011-07-27
      • 1970-01-01
      • 2020-04-18
      • 1970-01-01
      相关资源
      最近更新 更多