python3 安装 oss2 报错 ERROR: Failed building wheel for cryptography

python3 安装 oss2 报错 ERROR: Failed building wheel for cryptography 解决方法

在redhat 6.8安装了python3.7,但是 pip3在安装oss2时一直报错

pip3 install oss2

错误信息

error: can't find Rust compiler        If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.        To update pip, run:            pip install --upgrade pip        and then retry package installation.        If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.        This package requires Rust >=1.56.0.       [end of output]    note: This error originates from a subprocess, and is likely not a problem with pip.   ERROR: Failed building wheel for cryptography Successfully built oss2 aliyun-python-sdk-core crcmod pycryptodome Failed to build cryptography ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects

根据这里的提示,升级 pip后安装 oss2还是报cryptography错误。

v2 0bf9471050270450eb256a4d9255c711 1440w

猜测怀疑是cryptography版本太高了,装不进去,尝试安装低版本的

pip3 install cryptography==3.4.8
v2 75217725b0507d37b979acf66626177b 1440w

安装成功之后,于是再次安装oss也成功了

安装成功之后,于是再次安装oss也成功了
v2 fe5d9eca238c74009fcfa1b7263dd8e8 1440w 1