问题描述

pip命令安装第三方报错时,提示这样的错误信息

Failed cleaning build dir for cryptography
Failed to build cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

比如安装selenium失败,如下图
安装selenium失败示例图

解决方案

根据提示信息,给pip版本进行升级

python -m pip install --upgrade pip

执行成功后,就可以看到,你从什么版本升级什么版本

执行前面失败安装命令即可安装完即会提示Successfully在这里插入图片描述

万一哈,如果不成功

可以尝试执行这两行命令

pip install --only-binary :all: cryptography
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple

走过路过的朋友,如果有实战解决,或者有其他解决方案的,欢迎在评论区进行讨论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注