Python pip安装失败:无效的命令egg_info [英] Python pip install fails: invalid command egg_info

查看:446
本文介绍了Python pip安装失败:无效的命令egg_info的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我发现,当我尝试使用 Python 软件包时, href ="https://en.wikipedia.org/wiki/Pip_%28package_manager%29"> pip ,我收到以下错误.

I find that recently often when I try to install a Python package using pip, I get the error(s) below.

我在网上找到了一个参考,该参考必须使用下载目录中的" python2 setup.py install ",并且确实发现,如果我手动找到并下载该软件包(从pypi).

I found a reference online that one has to use "python2 setup.py install" from the download directory, and indeed find that this will then work if I manually find and download the package (from pypi).

但是,我不知道pip将软件包下载到哪里,和/或为什么这种方式失败.

But, I don't know where pip is downloading packages to, and/or why it is failing in this manner.

我尝试进行pip升级,但是它也以类似的方式失败,出现了一系列未知分发选项"错误(entry_points,zip_safe,test_suite,tests_require)!

I tried to do a pip upgrade, but it also failed in a similar manner, with a bunch of "Unknown distribution option" errors (entry_points, zip_safe, test_suite, tests_require)!

  • pip 1.0.1
  • ActivePython 2.7

尝试使用ActiveState的pypm失败,因为它们的库基较小,并且不包含这些软件包.

Trying to use ActiveState's pypm fails, because they have a smaller library base, and it doesn't include these packages.

C:\test>pip install requests-oauth
Downloading/unpacking requests-oauth
  Downloading requests-oauth-0.4.1.tar.gz
  Running setup.py egg_info for package requests-oauth
    E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
      warnings.warn(msg)
    E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
      warnings.warn(msg)
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: invalid command 'egg_info'
    Complete output from command python setup.py egg_info:
    E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
  warnings.warn(msg)

E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)

usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: -c --help [cmd1 cmd2 ...]
   or: -c --help-commands
   or: -c cmd --help

error: invalid command 'egg_info'

推荐答案

安装应该像pip install Distribute一样简单.

Should be as simple as pip install Distribute.

Distribute从版本0.7开始已合并到Setuptools中.如果您使用的是< = 0.6版本,请使用pip install --upgrade setuptoolseasy_install -U setuptools升级.

Distribute has been merged into Setuptools as of version 0.7. If you are using a version <=0.6, upgrade using pip install --upgrade setuptools or easy_install -U setuptools.

这篇关于Python pip安装失败:无效的命令egg_info的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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