IndexError:使用pip列出超出范围的索引 [英] IndexError: list index out of range using pip

查看:48
本文介绍了IndexError:使用pip列出超出范围的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 pip 1.5.4 并且我正在尝试使用以下命令为 python 安装 Google 客户端 API:sudo pip install --upgrade google-api-python-client

I'm using pip 1.5.4 and I'm trying to install Google Client API for python using the following command: sudo pip install --upgrade google-api-python-client

但我收到一个异常,内容为:

But I'm getting an exception which says:

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 1260, in 
prepare_files)[0]

IndexError: list index out of range

我尝试使用以下命令升级 pip:sudo pip install -U pip

I tried upgrading pip using the following command: sudo pip install -U pip

但它给出了与上述相同的异常.请提出解决方案.

But it gives the same exception as above.Please suggest a solution.

推荐答案

我认为是重复的:pip 安装损坏 (pkg_resources.find_distribution 在 req.py-prepare_files 中返回空列表)

所以,解决方案可以是:

So, solution can be:

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

这篇关于IndexError:使用pip列出超出范围的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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