Python的点子安装失败:无效的命令egg_info
我发现最近经常当我尝试安装Python包使用pip,我得到下面的错误(S)。Python的点子安装失败:无效的命令egg_info
我发现了一个参考网上一个人必须使用“python2的setup.py安装”从下载目录,果然发现这会工作,那么如果我手动查找和下载包(一封来自PyPI)。
但是,我不知道pip是在哪里下载软件包,和/或为什么它以这种方式失败。
我试图做一个点子升级,但它也失败了类似的方式,与一堆“未知的分布选项”错误(entry_points,zip_safe,test_suite,tests_require)!
- PIP 1.0.1
- ActivePython 2.7
尝试使用ActiveState的pypm失败了,因为他们有一个小图书馆基础,它不包括这些软件包。
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'
安装distribute,附带egg_info
。
应该像pip install Distribute
一样简单。
自0.7版起,分发已合并到Setuptools中。如果您使用< = 0.6的版本,请使用pip install --upgrade setuptools
或easy_install -U setuptools
进行升级。
不适合我。我已经发布了安装,但几乎每次尝试安装包时都会收到egg info错误 – 2013-07-26 16:05:04
@Henry:更新的答案 – 2013-08-20 20:20:31
对于那些仍然有错误的@Zorpix,您可能想要检查您要调用的pip版本。在Ubuntu上,我发现我的发行版本仍然被调用。 – 2013-10-15 17:58:49
请记住,你可能需要做pip install --upgrade Distribute
如果您有它已经安装并pip
可能会在某些系统(它是我的)呼吁pip2
为Python2。
请注意,对于典型的Python安装,这必须在Windows上以管理员模式完成。否则,很容易忽略Distribute的安装失败。 – 2015-02-01 06:07:56
这在我的Mac上适用于我 – 2016-07-31 02:19:57
由于分配已合并到setuptools的,现在建议安装/升级的setuptools来代替:
[sudo] pip install --upgrade setuptools
由于某种原因,我必须运行两次(在我的虚拟环境中,我分配了0.6.49和setuptools 0.6c11),然后我可以安装最新版本的pip而没有任何问题。 – glarrain 2013-12-02 21:53:48
@glarrain它发生在我身上!感谢您的支持!第一次卸载分发0.7,第二次卸载setuptools 0.6c11 – 2014-01-10 15:02:31
我有这个问题,以及与酿造的Python上OS X v10.9其他一些问题(小牛) 。
没有为我工作,我认为我的setuptools /分布设置是拙劣的。
我终于得到它运行
sudo easy_install -U setuptools
(我已编辑它) – 2015-11-29 17:38:55
这也适用于我! – Rommel 2017-09-12 08:25:09
貌似默认的easy_install在其当前位置破工作:
$ which easy_install /usr/bin/easy_install
克服这种情况的方法是使用的easy_install在网站包。例如:
$ sudo python /Library/Python/2.7/site-packages/easy_install.py boto
无上述工作对我来说在Ubuntu 12.04 LTS(精确穿山甲),和这里的我到底是怎么固定它:从download setuptools
下载ez_setup.py(请参阅“安装说明”一节)然后:
$ sudo python ez_setup.py
我希望它可以节省一些时间。
在CentOS 6.5,从一个干净简单的答案是安装:
yum -y install python-pip pip install -U pip pip install -U setuptools pip install -U setuptools
您没有看到双,你必须运行的setuptools升级两次。长答案如下:
使用yum安装python-pip
程序包会带来python-setuptools
作为依赖关系。这是一个很老的版本,因此它实际上安装了distribute (0.6.10)
。在安装包管理器之后,我们通常要更新它,所以我们做pip install -U pip
。目前版本的pip对我来说是1.5.6。
现在我们去更新setuptools,这个版本的pip很聪明,知道它应该先删除旧版本的发布。它是这样做的,但不安装它安装的最新版本的setuptools setuptools (0.6c11)
。
在这一点上,由于setuptools这个非常老的版本,各种各样的东西都被破坏了,但我们实际上已经到了一半。如果我们现在再次运行完全相同的命令,pip install -U setuptools
,旧版本的setuptools将被删除,并且将安装5.5.1版本。我不知道为什么pip不会让我们一口气直接推出新版本,但这是发生了什么,希望它能帮助其他人看到这一点,并知道你不会发疯。
当您尝试安装pycurl
时会发生此错误。
在这种情况下,你应该做的
sudo apt-get install libcurl4-gnutls-dev librtmp-dev
sudo apt-get install apache2-dev
解决我的问题
你回答了错误的问题吗? apache与安装pip有什么关系?你能详细说明这个链接吗? – 2015-10-27 10:05:38
我面临着同样的问题,我尝试了上述所有的答案。但不幸的是,以上都没有奏效。
作为一个说明,我终于通过来解决这个问题。
这解决了我的问题。事实证明,我安装了一个旧版本的发行版,并且安装了一个更旧版本的setuptools,并且比我的系统打包程序安装的新setuptools更受欢迎...卸载两个setuptool并分发,然后使用我的系统包装程序重新安装setuptools为我解决了这个问题。 – 2016-01-07 19:29:19
为我工作............谢谢 – Prateek 2017-11-13 10:16:43
pip install -U setuptools
和easy_install
将egg-info放在错误的目录中。
然后我刚刚重新安装apt-get install python-dev
。 让我安装之后我想要的驱动程序
我知道这是一个较老的问题,但这里是我使用cassandra-driver
实际安装在Windows 7/Python2上的步骤。 我在家里有Windows 10/Python3,我今晚会测试这个。我已经证实了这一点也适用于Windows 10与两个Python 2和3
问题
Command "python setup.py egg_info" failed with error code 1 in c:\users\Frito\appdata\local\temp\pip-build-7dgmdc\cassandra-driver
TL; DR解决方案
- 安装https://www.microsoft.com/en-us/download/details.aspx?id=44266(微软的Visual C++编译器for Python 2.7)
解决方案(我愿意为爱的人解释为什么这个工作)
- 试图
pip install cassandra-driver
,并得到了上述错误信息 - 试图
pip install --pre cassandra-driver
并得到了以下错误
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27 Command "c:\users\Frito\.virtualenvs\symdash\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\Frito\\appdata\\local\\temp\\pip-build-sesxxu\\cassandra-driver\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\Frito\appdata\local\temp\pip-ujsxsk-record\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\Frito\.virtualenvs\symdash\include\site\python2.7\cassandra-driver" failed with error code 1 in c:\users\Frito\appdata\local\temp\pip-build-sesxxu\cassandra-driver
- 安装
Microsoft Visual C++ Compiler for Python 2.7
- 成功执行
pip install --pre cassandra-driver
- 成功执行
pip uninstall cassandra-driver
- 成功执行
pip install cassandra-driver
要重申的是,我真的不知道为什么这个工作。现在我的两个主要结论是,无论是C++编译器都需要还是,运行--pre
选项时第一次安装了“常规”安装中缺少的一些依赖关系。当我有更多细节时,我会在下班后更新。
这是唯一对我有用的东西。谢谢! – Battousai 2016-08-12 19:26:55
我只是将liquidki的答案转换为Ubuntu命令。在基于Ubuntu的系统上工作!:
sudo apt -y install python-pip
pip install -U pip
sudo pip install -U setuptools
对我来说,将pip从8.1.1升级到9.0.1解决了这个问题。
你可以运行诸如sudo -H pip2 install --upgrade pip
的东西来升级你的点子版本。
对我来说,它安装'python-dev' – lmaooooo 2016-04-15 15:31:00