Python3.5安装oss2报ImportError: No module named ‘setuptools_rust‘

错误详情

Collecting oss2
  Downloading https://mirrors.aliyun.com/pypi/packages/4e/0a/c2c1bc04f2b0c43e5b54ade829f4e8c35aa13db42171252b1dd62780ffa5/oss2-2.14.0.tar.gz (224kB)
    100% |████████████████████████████████| 225kB 4.3MB/s 
Collecting requests!=2.9.0 (from oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl (61kB)
    100% |████████████████████████████████| 61kB 11.4MB/s 
Collecting crcmod>=1.7 (from oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/6b/b0/e595ce2a2527e169c3bcd6c33d2473c1918e0b7f6826a043ca1245dd4e5b/crcmod-1.7.tar.gz (89kB)
    100% |████████████████████████████████| 92kB 10.3MB/s 
Collecting pycryptodome>=3.4.7 (from oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/af/ef/bedde9b7a1f237b743eb307e6c247369c2ae5ca6a79b61c064698cfd78cd/pycryptodome-3.10.1-cp35-abi3-manylinux1_x86_64.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 259kB/s 
Collecting aliyun-python-sdk-kms>=2.4.1 (from oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/e5/2c/2056559e7ece7bcb59aabfab54cb67252743993c223e00a42e2a745c3080/aliyun_python_sdk_kms-2.14.0-py2.py3-none-any.whl (70kB)
    100% |████████████████████████████████| 71kB 2.0MB/s 
Collecting aliyun-python-sdk-core>=2.13.12 (from oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/0c/3f/2c6a7a0617a36d9afb3d13ffece4567ee5112b32aeb57f9aa09c7f8bcf89/aliyun-python-sdk-core-2.13.32.tar.gz (446kB)
    100% |████████████████████████████████| 450kB 464kB/s 
Collecting six (from oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests!=2.9.0->oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 11.4MB/s 
Collecting certifi>=2017.4.17 (from requests!=2.9.0->oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl (147kB)
    100% |████████████████████████████████| 153kB 6.3MB/s 
Collecting urllib3<1.27,>=1.21.1 (from requests!=2.9.0->oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/09/c6/d3e3abe5b4f4f16cf0dfc9240ab7ce10c2baa0e268989a4e3ec19e90c84e/urllib3-1.26.4-py2.py3-none-any.whl (153kB)
    100% |████████████████████████████████| 153kB 5.9MB/s 
Collecting chardet<5,>=3.0.2 (from requests!=2.9.0->oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl (178kB)
    100% |████████████████████████████████| 184kB 5.4MB/s 
Collecting jmespath<1.0.0,>=0.9.3 (from aliyun-python-sdk-core>=2.13.12->oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/07/cb/5f001272b6faeb23c1c9e0acc04d48eaaf5c862c17709d20e3469c6e0139/jmespath-0.10.0-py2.py3-none-any.whl
Collecting cryptography>=2.6.0 (from aliyun-python-sdk-core>=2.13.12->oss2)
  Downloading https://mirrors.aliyun.com/pypi/packages/fa/2d/2154d8cb773064570f48ec0b60258a4522490fcb115a6c7c9423482ca993/cryptography-3.4.6.tar.gz (546kB)
    100% |████████████████████████████████| 552kB 2.6MB/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-wgl7mey2/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ImportError: No module named 'setuptools_rust'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wgl7mey2/cryptography/
You are using pip version 8.1.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

在这里插入图片描述

解决方案

  • 第一种解决方案,python命令重新安装pip,命令如下所示。
#其他的版本可以试着换下中间的3.5
wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
python get-pip.py
  • 第二种方案,使用easy_install重新安装pip,命令如下所示。
sudo easy_install pip==20.3.4
  • 重新安装pip后,安装oss2模块成功,如下图所示。
    在这里插入图片描述

posted on 2021-03-19 12:41  愤怒的苹果ext  阅读(31)  评论(0编辑  收藏  举报

导航