"python setup.py egg_info" failed with error code 1---更新setuptools再重新install

在尝试安装gevent时遇到错误,错误信息显示`python setup.py egg_info`失败,原因是setuptools版本过低。解决方案是通过升级setuptools,使用`pip install --upgrade setuptools`命令更新setuptools到最新版本,然后成功卸载旧版本并安装了新版本setuptools。最后,重新运行安装命令,问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Collecting gevent==1.4.0 (from -r requirements.txt (line 17))

  Downloading http://mirrors.xxxxx.com/pypi/packages/ed/27/6c49b70808f569b66ec7fac2e78f076e9b204db9cf5768740cff3d5a07ae/gevent-1.4.0.tar.gz (5.2MB)

    100% |████████████████████████████████| 5.2MB 31.0MB/s

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File "<string>", line 20, in <module>

      File "/tmp/pip-build-aBLKRt/gevent/setup.py", line 427, in <module>

        run_setup(EXT_MODULES, run_make=_BUILDING)

      File "/tmp/pip-build-aBLKRt/gevent/setup.py", line 411, in run_setup

        "signal_os_incompat = gevent.monkey:_subscribe_signal_os",

      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup

        _setup_distribution = dist = klass(attrs)

      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__

        self.fetch_build_eggs(attrs.pop('setup_requires'))

      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs

        parse_requirements(requires), installer=self.fetch_build_egg

      File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 601, in resolve

        requirements = list(requirements)[::-1]  # set up the stack

      File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2839, in parse_requirements

        line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")

      File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2817, in scan_list

        "Expected ',' or end-of-list in",line,"at",line[p:]

    ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'")

 

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-aBLKRt/gevent

 


更新下setuptools

$ pip install --upgrade setuptools

Collecting setuptools

  Downloading http://mirrors.xxxxx.com/pypi/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl (575kB)

    100% |████████████████████████████████| 577kB 16.0MB/s

Installing collected packages: setuptools

  Found existing installation: setuptools 0.9.8

    Uninstalling setuptools-0.9.8:

      Successfully uninstalled setuptools-0.9.8

Successfully installed setuptools-41.0.1

 

 

重新运行:

/usr/bin/pip install  -r requirements.txt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值