Pycrypto在windows上为Pycrypto生成控制盘失败

2024-05-28 19:49:03 发布

您现在位置:Python中文网/ 问答频道 /正文

有人能帮我吗?本指南内容如下: PyCrypto on python 3.5

命令行:

creating build\temp.win32-3.6\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/ -Isrc/inc-msvc/ -IC:\Python36-32\include -IC:\Python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt" /Tcsrc/winrand.c /Fobuild\temp.win32-3.6\Release\src/winrand.obj
  winrand.c
  C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt\inttypes.h(26): error C2061: syntax error: identifier 'intmax_t'

C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt\inttypes.h(27): error C2061: syntax error: identifier 'rem'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt\inttypes.h(27): error C2059: syntax error: ';'

C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt\inttypes.h(28): error C2059: syntax error: '}'

C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt\inttypes.h(30): error C2061: syntax error: identifier 'imaxdiv_t'


  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for pycrypto

  Running setup.py clean for pycrypto
Failed to build pycrypto

Installing collected packages: pycrypto
  Running setup.py install for pycrypto ... error

 warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

    ----------------------------------------
Command "C:\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\pip-build-1hsm_c69\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\CHRIST~1\AppData\Local\Temp\pip-wl7h4k32-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\CHRIST~1\AppData\Local\Temp\pip-build-1hsm_c69\pycrypto\

有没有办法安装PyCrypto?已安装Visual Studio 2015;是否应为Visual Studio设置环境变量?


Tags: buildincludewindowserrorfilesprogramx86studio
2条回答

您的python版本是3.6,这就是您可以运行此错误的原因。您需要更改python3.5,正确地说是3.5.2。我认为你可以成功地进口。

尝试安装Python的微软Visual C++编译器,用于使用的版本。 This link适用于版本2.7。找到并下载你的。我相信会有帮助的!

相关问题 更多 >

    热门问题