首页 > 其他 > 详细

ERROR: Failed building wheel for cryptography

时间:2021-03-08 16:11:06      阅读:354      评论:0      收藏:0      [点我收藏+]

debian下python3.9安装cryptography报错

完整错误信息:

running build_rust
  
      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) 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
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      4) Ensure you have a recent Rust toolchain installed:
         https://cryptography.io/en/latest/installation.html#rust
      5) If you are experiencing issues with Rust for *this release only* you may
         set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
      =============================DEBUG ASSISTANCE=============================
  
  error: Can not find Rust compiler
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

首先确保一些依赖包已经正常安装

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus

sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev

sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev

sudo apt-get install libssl-dev openssl

sudo apt-get install libffi-dev

确认依赖没问题后可以尝试以下三种解决方式:

  1. 升级pip后再试
    python -m pip install --upgrade pip

如果发现升级失败可以删除
"/你的安装目录/site-packages/pip-你的版本号.dist-info" 目录重新执行 python -m pip install --upgrade pip 再试

  1. 先安装pep517再安装cryptography
pip install pep517
pip install cryptography
  1. 直接忽略build rust编译器
export CRYPTOGRAPHY_DONT_BUILD_RUST=1
pip install cryptography

ERROR: Failed building wheel for cryptography

原文:https://www.cnblogs.com/iamy/p/14499590.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!