windows安装pycrypto出错解决

1.执行命令报错

pip install pycrypto

Installing collected packages: pycrypto
Running setup.py install for pycrypto ... error
ERROR: Command errored out with exit status 1

2.下载安装 visual studio

https://visualstudio.microsoft.com/zh-hans/

 

3.错误原因

C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(53): error C2059: 语法错误:“)”
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(55): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

inttypes.h 出错

4.解决方法

复制代码
1.找到 Visual Studio 2022 的安装位置,右键,打开文件所在位置

2.去到目录:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include

3.找到 stdint.h

4.将 stdint.h 复制到 Windows Kits报错的路径:C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(100): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面) 的 C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt 目录下

5.修改 C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h

将第14行的尖括号改为双引号 #include <stdint.h> --> #include "stdint.h"
复制代码

5.问题解决,可以正常安装 pycrypto

posted @   chenjianwen  阅读(1307)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2021-11-17 oom内存溢出进程被杀处理办法
点击右上角即可分享
微信分享提示