安装pythoncrypto 出现的一连串错误

安装pythoncrypto 出现的一连串错误

**1.错误信息如下:

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building ‘Crypto.Random.OSRNG.winrandom’ extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------**
ERROR: Failed building wheel for pycrypto
ERROR: Command errored out with exit status 1:

解决办法:

提示要安装VC++14.0版本,拷贝错误提示的那串连接https://visualstudio.microsoft.com/visual-cpp-build-tools/,如果网络好应该是能很快下下来,网络不好的话可以尝试找一个这样的文件:vs_buildtools__1286720716.1626834762.exe,这个文件可以自动帮你安装,注意配置路径,提示需要很大空间。装好之后要重启。安装的内容:
Visual Studio 2019 version 16.10.4

2. 重启之后继续安装pycrypto,还是会报错:
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(81): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(87): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(94): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(100): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
error: command 'D:\\software\\vc++\\install\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
解决办法:

把安装目录下的D:\software\vc++\install\VC\Tools\MSVC\14.29.30037\include\stdint.h 拷贝到 C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stdint.h
编辑 C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h 将#include <stdint.h> 改为#include “stdint.h”

-----以上解决办法均来源于网络+自己的实操,文章如有涉及侵权,请作者及时告知

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值