pip 无法安装任何东西,错误:无效命令“egg_info" [英] pip fails to install anything, error: invalid command 'egg_info'

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

问题描述

除了 Mac OSX 自带的 Python 版本之外,我最近还从他们的网站下载了 Python.这是我开始在使用 pip 安装软件包时遇到问题的时候.

sudo pip install -vvv pygoogle

将输出以下内容:

目录/Users/robot/Library/Caches/pip/http"或其父目录不属于当前用户所有,缓存已禁用.请检查该目录的权限和所有者.如果使用 sudo 执行 pip,您可能需要 sudo 的 -H 标志.目录/Users/robot/Library/Caches/pip/http"或其父目录不属于当前用户所有,缓存已被禁用.请检查该目录的权限和所有者.如果使用 sudo 执行 pip,您可能需要 sudo 的 -H 标志.收集pygoogle获取页面 https://pypi.python.org/simple/pygoogle/启动新的HTTPS连接(一):pypi.python.org"GET/simple/pygoogle/HTTP/1.1" 200 2331 个用于搜索 pygoogle 版本的位置:* https://pypi.python.org/simple/pygoogle/获取页面 https://pypi.python.org/simple/pygoogle/"GET/simple/pygoogle/HTTP/1.1" 200 233分析页面 https://pypi.python.org/simple/pygoogle/中的链接找到链接 https://pypi.python.org/packages/source/p/pygoogle/pygoogle-0.6.tar.gz#md5=f9053f1b7350b899811a7c9226c8a2cb(来自 https://pypi.python.org/simple/pygoogle/),版本: 0.6跳过链接 http://www.google.com/apis/(来自 https://pypi.python.org/simple/pygoogle/);不是文件获取/packages/source/p/pygoogle/pygoogle-0.6.tar.gz HTTP/1.1"200 33672下载 pygoogle-0.6.tar.gz从 URL 下载 https://pypi.python.org/packages/source/p/pygoogle/pygoogle-0.6.tar.gz#md5=f9053f1b7350b899811a7c9226c8a2cb(来自 https://pypi.python.org/simple/pygoogle/)运行 setup.py(路径:/private/tmp/pip-build-1jAoXq/pygoogle/setup.py)egg_info 包 pygoogle运行命令 python setup.py egg_info用法:-c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]或:-c --help [cmd1 cmd2 ...]或:-c --help-commands或:-c cmd --help错误:无效的命令egg_info"命令 python setup.py egg_info 的完整输出:用法:-c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]或:-c --help [cmd1 cmd2 ...]或:-c --help-commands或:-c cmd --help错误:无效的命令egg_info"----------------------------------------打扫干净...命令python setup.py egg_info"在/private/tmp/pip-build-1jAoXq/pygoogle 中失败,错误代码为 1异常信息:回溯(最近一次调用最后一次):文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py",第223行,主要status = self.run(options, args)文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py",第282行,在跑required_set.prepare_files(finder)文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py",第334行,在准备文件functools.partial(self._prepare_file, finder))文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py",第321行,在_walk_req_to_installmore_reqs = 处理程序(req_to_install)文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py",第505行,在_prepare_fileabstract_dist.prep_for_dist()文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py",第123行,在prep_for_distself.req_to_install.run_egg_info()文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py",第407行,在run_egg_infocommand_desc='python setup.py egg_info')文件/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py",第732行,在call_subprocess% (command_desc, proc.returncode, cwd))安装错误:命令python setup.py egg_info"在/private/tmp/pip-build-1jAoXq/pygoogle 中失败,错误代码为 1

我已经尝试了以下所有方法,他们只是告诉我安装工具包已经安装.

sudo pip install setuptoolssudo pip install [--upgrade] setuptoolseasy_install [-U] 安装工具

请注意以下命令输出:

where python/Library/Frameworks/Python.framework/Versions/2.7/bin/python/usr/local/bin/python哪条蟒蛇/Library/Frameworks/Python.framework/Versions/2.7/bin/python点子在哪里/Library/Frameworks/Python.framework/Versions/2.7/bin/pip/usr/local/bin/pip哪个点/Library/Frameworks/Python.framework/Versions/2.7/bin/pip回声 $SHELL/bin/zsh

还有我的 .zprofile:

# 为 Python 2.7 设置 PATH# 原始版本保存在.zprofile.pysavePATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"导出路径

解决方案

尝试 pip install --upgrade setuptoolseasy_install -U setuptools

下载这个文件并执行python ez_setup.py

I recently downloaded python from their website in addition to the Python version that already comes with Mac OSX. This is when I began to have problems installing packages with pip.

sudo pip install -vvv pygoogle

Will output the following:

The directory '/Users/robot/Library/Caches/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 '/Users/robot/Library/Caches/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.
Collecting pygoogle
  Getting page https://pypi.python.org/simple/pygoogle/
  Starting new HTTPS connection (1): pypi.python.org
  "GET /simple/pygoogle/ HTTP/1.1" 200 233
  1 location(s) to search for versions of pygoogle:
  * https://pypi.python.org/simple/pygoogle/
  Getting page https://pypi.python.org/simple/pygoogle/
  "GET /simple/pygoogle/ HTTP/1.1" 200 233
  Analyzing links from page https://pypi.python.org/simple/pygoogle/
    Found link https://pypi.python.org/packages/source/p/pygoogle/pygoogle-0.6.tar.gz#md5=f9053f1b7350b899811a7c9226c8a2cb (from https://pypi.python.org/simple/pygoogle/), version: 0.6
    Skipping link http://www.google.com/apis/ (from https://pypi.python.org/simple/pygoogle/); not a file
  "GET /packages/source/p/pygoogle/pygoogle-0.6.tar.gz HTTP/1.1" 200 33672
  Downloading pygoogle-0.6.tar.gz
  Downloading from URL https://pypi.python.org/packages/source/p/pygoogle/pygoogle-0.6.tar.gz#md5=f9053f1b7350b899811a7c9226c8a2cb (from https://pypi.python.org/simple/pygoogle/)
  Running setup.py (path:/private/tmp/pip-build-1jAoXq/pygoogle/setup.py) egg_info for package pygoogle
    Running command python setup.py egg_info
    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:
    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'

    ----------------------------------------
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-1jAoXq/pygoogle
Exception information:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 282, in run
    requirement_set.prepare_files(finder)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 334, in prepare_files
    functools.partial(self._prepare_file, finder))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 321, in _walk_req_to_install
    more_reqs = handler(req_to_install)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 505, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 123, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 407, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 732, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-1jAoXq/pygoogle

I have already tried all of the following, they just tell me the package setuptools is already installed.

sudo pip install setuptools
sudo pip install [--upgrade] setuptools
easy_install [-U] setuptools

Please note the following commands output:

where python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/usr/local/bin/python

which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

where pip
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip
/usr/local/bin/pip

which pip
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip

echo $SHELL
/bin/zsh

And my .zprofile:

# Setting PATH for Python 2.7
# The orginal version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

解决方案

Try pip install --upgrade setuptools or easy_install -U setuptools

or

Download this file and execute python ez_setup.py

这篇关于pip 无法安装任何东西,错误:无效命令“egg_info"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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