Python3.7上安装PyCrypto

  1. 直接pip install PyCrypto报错

  2. 安装VS2019, 安装MSBuild, 再编译, 还是报错

  3. Python3.7上安装PyCrypto

  4. 注意要重开cmd, 让最新的环境变量生效

  5. Python3.7上安装PyCrypto

  6. 找到报错的地方"D:\Windows Kits\10\include\10.0.18362.0\ucrt\inttypes.h", 没错, 就是这个!

  7. 参考:https://my.oschina.net/mengyoufengyu/blog/1524422 中的第一种方案, 将"D:\Program Files (x86)\Microsoft Visual Studio\install\VC\Tools\MSVC\14.24.28314\include" MSBuild工具包里面的stdint.h复制到"D:\Windows Kits\10\Include\10.0.18362.0\ucrt"目录中, 没错, 就是复制到报错文件的目录.

  8. 将报错的源文件"inttypes.h"中的第13行"#include <stdint.h>"改成#include "stdint.h"后再编译.大功告成!

  9. Python3.7上安装PyCrypto