Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
397 views
in Technique[技术] by (71.8m points)

visual studio - Microsoft Windows Python-3.6 PyCrypto installation error

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

  1. Open command prompt
  2. Setup VC environment by runing vcvars*.bat (choose file name depending on VC version and architecture)
  3. set CL=-FI"Full-Pathstdint.h" (use real value for Full-Path for the environment)
  4. pip install pycrypto

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...