Microsoft Windows Python-3.6 PyCrypto安装错误 [英] Microsoft Windows Python-3.6 PyCrypto installation error

查看:235
本文介绍了Microsoft Windows Python-3.6 PyCrypto安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pip install pycrypto在python3.5.2上正常工作,但在python3.6上失败,并出现以下错误:

pip install pycrypto works fine with python3.5.2 but fails wiht python3.6 with the following error:

inttypes.h(26):错误C2061:语法错误:标识符'intmax_t'

inttypes.h(26): error C2061: syntax error: identifier 'intmax_t'

推荐答案

Python安装目录中的文件include \ pyport.h没有 #include< stdint.h> .这将使 intmax_t 未定义.

The file include\pyport.h in Python installation directory does not have #include < stdint.h > anymore. This leaves intmax_t undefined.

Microsoft VC编译器的一种解决方法是通过操作系统环境变量 CL 强制包含 stdint.h :

A workaround for Microsoft VC compiler is to force include stdint.h via OS environment variable CL:

  1. 打开命令提示符
  2. 通过运行vcvars * .bat设置VC环境(根据VC版本和体系结构选择文件名)
  3. 设置CL = -FI"Full-Path \ stdint.h"(为环境的Full-Path使用实际值)
  4. pip安装pycrypto

这篇关于Microsoft Windows Python-3.6 PyCrypto安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆