pip安装软件时出现Command “python setup.py egg_info“ failed with error code 1 in /tmp的解决方案

问题出现
pip3 install scrapy
在这里插入图片描述

[root@CentOS-s-1-CPU-1-GB ~]# pip3 install scrapy
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting scrapy
  Downloading https://mirrors.aliyun.com/pypi/packages/e2/8a/e3870cd597bbd4f47d7e1c97bbb67a6293270b9c413e083058ce6d6c7eb7/Scrapy-2.6.2-py2.py3-none-any.whl (264kB)
    100% |????????????????????????????????| 266kB 294kB/s 
Collecting pyOpenSSL>=16.2.0 (from scrapy)
  Downloading https://mirrors.aliyun.com/pypi/packages/d5/9f/9c0e3288b85f907a008f9d31318b0e4de31b2f67724a8745e633741f609c/pyOpenSSL-22.0.0-py2.py3-none-any.whl (55kB)
    100% |????????????????????????????????| 61kB 333kB/s 
Collecting zope.interface>=4.1.3 (from scrapy)
  Downloading https://mirrors.aliyun.com/pypi/packages/67/67/8178e511cd4f0a481082aac1c0e2d64c520a5ee92ea8ce42d8297a4fca7e/zope.interface-5.4.0-cp36-cp36m-manylinux1_x86_64.whl (251kB)
    100% |????????????????????????????????| 256kB 303kB/s 
Collecting lxml>=3.5.0; platform_python_implementation == "CPython" (from scrapy)
  Downloading https://mirrors.aliyun.com/pypi/packages/0f/4e/e139648475c0eb42cdb813461ae11f567e1888a20d7dfd5256f47e32909d/lxml-4.9.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (5.6MB)
    100% |????????????????????????????????| 5.6MB 307kB/s 
Collecting parsel>=1.5.0 (from scrapy)
  Downloading https://mirrors.aliyun.com/pypi/packages/23/1e/9b39d64cbab79d4362cdd7be7f5e9623d45c4a53b3f7522cd8210df52d8e/parsel-1.6.0-py2.py3-none-any.whl
Collecting protego>=0.1.15 (from scrapy)
  Downloading https://mirrors.aliyun.com/pypi/packages/81/4d/3e01f10d6dd2d35793711c2e27a07e547c6aec0ab8d3199bb83e68956fdb/Protego-0.2.1-py2.py3-none-any.whl
Collecting cryptography>=2.0 (from scrapy)
  Downloading https://mirrors.aliyun.com/pypi/packages/89/d9/5fcd312d5cce0b4d7ee8b551a0ea99e4ea9db0fdbf6dd455a19042e3370b/cryptography-37.0.4.tar.gz (585kB)
    100% |????????????????????????????????| 593kB 330kB/s 
    Complete output from command python setup.py egg_info:
    
            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:
    
            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-dgfowu9k/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dgfowu9k/cryptography/

解决方案
pip3 install --upgrade --force pip
在这里插入图片描述

[root@CentOS-s-1-CPU-1-GB ~]# pip3 install --upgrade --force pip
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pip
  Downloading https://mirrors.aliyun.com/pypi/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB)
    100% |????????????????????????????????| 1.7MB 330kB/s 
Installing collected packages: pip
Successfully installed pip-21.3.1

解决后展示再次安装成功
在这里插入图片描述

[root@CentOS-s-1-CPU-1-GB ~]# scrapy -h
/usr/local/lib/python3.6/site-packages/OpenSSL/crypto.py:8: CryptographyDeprecationWarning: Pported by the Python core team. Therefore, support for it is deprecated in cryptography and w release.
  from cryptography import utils, x509
Scrapy 2.6.2 - no active project

Usage:
  scrapy <command> [options] [args]

Available commands:
  bench         Run quick benchmark test
  commands      
  fetch         Fetch a URL using the Scrapy downloader
  genspider     Generate new spider using pre-defined templates
  runspider     Run a self-contained spider (without creating a project)
  settings      Get settings values
  shell         Interactive scraping console
  startproject  Create new project
  version       Print Scrapy version
  view          Open URL in browser, as seen by Scrapy

  [ more ]      More commands available when run from project directory

Use "scrapy <command> -h" to see more info about a command
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

reg183

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值