Microsoft Windows Python-3.6 PyCrypto installation error

后端 未结 8 2161
陌清茗
陌清茗 2020-11-29 00:30

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

inttypes.h(26): error C2061: syntax e

8条回答
  •  醉话见心
    2020-11-29 00:56

    For ppl who is encountering same situation as mine:

    Env

    • Windows 10 Enterprise v10.0.18363 Build 18363
    • Python 3.8

    Steps

    1. Download Microsoft C++ Build Tools at https://visualstudio.microsoft.com/visual-cpp-build-tools/
    2. Run above setup exe and install default components
      • MSVC v142 - VS 2019 C++ x64/x86 build tools
      • Windows 10 SDK
      • C++ CMake tools for windows
      • Testing tools core features - Build Tools
      • C++ AddressSanitizer(Experimental)
    3. Reboot PC
    4. Start menu > x64 Native Tools Command Prompt for VS 2019, a cmd window will pop up
    5. Execute set CL=-FI"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include\stdint.h"
    6. Run pip install pycrypto in a cmd window(may need admin privilege) 1

提交回复
热议问题