pip install scrapy 失败的解决办法

pip install scrapy 错误信息

Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting scrapy
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/d2/b1/105fe9a289e5bb64ec104076546f72060296d9989a0fc31a8b608c810868/Scrapy-2.2.0-py2.py3-none-any.whl (241 kB)
     || 241 kB 29.1 MB/s 
Collecting w3lib>=1.17.0
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/a3/59/b6b14521090e7f42669cafdb84b0ab89301a42f1f1a82fcf5856661ea3a7/w3lib-1.22.0-py2.py3-none-any.whl (20 kB)
Collecting PyDispatcher>=2.0.5
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/cd/37/39aca520918ce1935bea9c356bcbb7ed7e52ad4e31bff9b943dfc8e7115b/PyDispatcher-2.0.5.tar.gz (34 kB)
Collecting service-identity>=16.0.0
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/e9/7c/2195b890023e098f9618d43ebc337d83c8b38d414326685339eb024db2f6/service_identity-18.1.0-py2.py3-none-any.whl (11 kB)
Collecting cssselect>=0.9.1
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/3b/d4/3b5c17f00cce85b9a1e6f91096e1cc8e8ede2e1be8e96b87ce1ed09e92c5/cssselect-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting cryptography>=2.0
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/3c/04/686efee2dcdd25aecf357992e7d9362f443eb182ecd623f882bc9f7a6bba/cryptography-2.9.2-cp35-abi3-manylinux2010_x86_64.whl (2.7 MB)
     || 2.7 MB 20.0 MB/s 
Collecting Twisted>=17.9.0
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/4a/b4/4973c7ccb5be2ec0abc779b7d5f9d5f24b17b0349e23240cfc9dc3bd83cc/Twisted-20.3.0.tar.bz2 (3.1 MB)
     || 3.1 MB 30.2 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-48gtgdpk/Twisted/setup.py'"'"'; __file__='"'"'/tmp/pip-install-48gtgdpk/Twisted/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-48gtgdpk/Twisted/pip-egg-info
         cwd: /tmp/pip-install-48gtgdpk/Twisted/
    Complete output (33 lines):
    WARNING: The repository located at mirrors.cloud.aliyuncs.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.cloud.aliyuncs.com'.
    ERROR: Could not find a version that satisfies the requirement incremental>=16.10.1 (from versions: none)
    ERROR: No matching distribution found for incremental>=16.10.1
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/dist-packages/setuptools/installer.py", line 128, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpfh5tnabd', '--quiet', '--index-url', 'http://mirrors.cloud.aliyuncs.com/pypi/simple/', 'incremental>=16.10.1']' returned non-zero exit status 1.
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-install-48gtgdpk/Twisted/setup.py", line 20, in 
        setuptools.setup(**_setup["getSetupArgs"]())
      File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 164, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 159, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 699, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 758, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/usr/local/lib/python3.8/dist-packages/setuptools/installer.py", line 130, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpfh5tnabd', '--quiet', '--index-url', 'http://mirrors.cloud.aliyuncs.com/pypi/simple/', 'incremental>=16.10.1']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决方法:(注意:不要过度关注于最后一个错误,要从前面第一个错误找起;否则百度一天也解决不了)

 sudo pip install incremental==17.5.0

成功!

你可能感兴趣的:(devops,python,pip,python,scrapy)