【问题标题】:Pycrypto failed building wheel for pycrypto on windowsPycrypto 未能在 Windows 上为 pycrypto 构建轮子
【发布时间】:2017-11-18 09:17:48
【问题描述】:

有人可以帮助我吗?本指南剂量工作: 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 设置环境变量吗?

【问题讨论】:

    标签: python windows visual-studio-2012


    【解决方案1】:

    你的python版本是3.6,这就是为什么你可以运行这个错误。你需要更改python3.5,正确的是3.5.2。我认为您可以成功导入。

    【讨论】:

      【解决方案2】:

      尝试为您正在使用的版本安装 Microsoft Visual C++ Compiler for Python。 This link 适用于 2.7 版。查找并下载您的。我相信它会有所帮助!

      【讨论】:

      • 欢迎来到 Stack Overflow!虽然链接是分享知识的好方法,但如果它们在未来被破坏,它们将无法真正回答问题。将回答问题的链接的基本内容添加到您的答案中。如果内容太复杂或太大而无法在此处放置,请描述所提出解决方案的总体思路。请记住始终保留对原始解决方案网站的链接引用。见:How do I write a good answer?
      猜你喜欢
      • 1970-01-01
      • 2010-12-13
      • 2012-07-09
      • 1970-01-01
      • 2013-09-04
      • 2012-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多