pip安装已损坏(pkg_resources.find_distribution在req.py-prepare_files中返回空列表) [英] pip install broken (pkg_resources.find_distribution returns empty list in req.py-prepare_files)

查看:145
本文介绍了pip安装已损坏(pkg_resources.find_distribution在req.py-prepare_files中返回空列表)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某个时候,我的pip安装中断了(我怀疑是在升级到Ubuntu 14.04时),并且我无法通过完全删除并重新安装(通过synaptic软件包管理器)来破坏它.并非所有软件包都会出现这种情况,而是会出现一些常见的软件包,例如autopep8甚至setuptools本身.

At some point my pip installation broke (I suspect when upgrading to Ubuntu 14.04) and I haven't been able to unbreak it by completely removing it and reinstalling (via synaptic package manager). It doesn't occur for all packages but for a few common ones such as autopep8 and even setuptools itself.

我得到的错误是

Downloading from URL https://pypi.python.org/packages/3.3/p/pep8/pep8-1.5.6-py2.py3-none-any.whl#md5=c7da9fb6a4316b53b6a873de076441e2 (from https://pypi.python.org/simple/pep8/)
Cleaning up...
  Removing temporary dir /tmp/pip_build_tclose...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1259, in prepare_files
    )[0]
IndexError: list index out of range

,当pkg_resources.find_distribution(<what-appears-to-be-a-temp-build-directory-for-package-to-install>)返回空列表时发生.我有点没主意,所以任何指针都将不胜感激.

which occurs when pkg_resources.find_distribution(<what-appears-to-be-a-temp-build-directory-for-package-to-install>) returns an empty list. I am kind of out of ideas so any pointers would be most appreciated.

推荐答案

此问题已解决:

pip install --no-use-wheel --upgrade distribute

这篇关于pip安装已损坏(pkg_resources.find_distribution在req.py-prepare_files中返回空列表)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆