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

曾经终败给现在 2022-12-11 06:29 306阅读 0赞

问题描述

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

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

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

解决方案

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

  1. sudo apt install gcc # ubuntu
  2. sudo yum install gcc # centos

然后直接一条命令build cryptography

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

接着执行

  1. pip install cryptography

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

注意:本方法还适用其他安装pwntools时出现的问题

参考资料

  • https://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py

发表评论

表情:
评论列表 (有 0 条评论,306人围观)

还没有评论,来说两句吧...

相关阅读