ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

问题描述

最近在ubuntu16.04上安装pwntools卡到一个问题,报错提示如下:

ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

发现是build cryptography的时候出错,百度搜索的结果中没一个顶用的,最终在stackoverflow上找到了解决方案。

解决方案

本质上就是要build cryptography,当你环境中有c编译器时直接一条命令即可解决,因此注意先保证安装了gcc

sudo apt install gcc  # ubuntu
sudo yum install gcc  # centos

然后直接一条命令build cryptography

sudo apt-get install build-essential libssl-dev libffi-dev python-dev  # ubuntu
sudo yum install gcc libffi-devel python-devel OpenSSL-devel  # centos

接着执行

pip install cryptography

最后再尝试pip install <package>即可

参考资料

  • https://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页