running install

running build

running build_py

running build_ext

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

building 'Crypto.Random.OSRNG.winrandom' extension

C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/ -Isrc/inc-msvc/ -IC:Python36include -IC:Python36include

winrand.c

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(26): error C2061: syntax error: identifier 'intmax_t'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(27): error C2061: syntax error: identifier 'rem'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(27): error C2059: syntax error: ';'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(28): error C2059: syntax error: '}'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(30): error C2061: syntax error: identifier 'imaxdiv_t'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(30): error C2059: syntax error: ';'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(40): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(41): error C2146: syntax error: missing ')' before identifier '_Number'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(41): error C2061: syntax error: identifier '_Number'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(41): error C2059: syntax error: ';'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(42): error C2059: syntax error: ')'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(45): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2146: syntax error: missing ')' before identifier '_Numerator'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2061: syntax error: identifier '_Numerator'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2059: syntax error: ';'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2059: syntax error: ','

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(48): error C2059: syntax error: ')'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(50): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(56): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(63): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(69): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(76): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(82): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(89): error C2143: syntax error: missing '{' before '__cdecl'

C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(95): error C2143: syntax error: missing '{' before '__cdecl'

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

经过一番百度和Google以及尝试终于成功安装pycrypto 2.6.1,具体解决方法如下:

  1. 设置Microsoft Visual Studio 14.0的环境变量,如图:

    wKioL1l7HiXSMl-MAACx6J9oVmM392.png-wh_50

  2. 打开cmd,执行如下命令(划重点,不是有些blog上面的“/”,也不是"\",我试成功的是"",另外“-”是需要的,不要问我为啥,我也是试出来的):set CL=-FI"%VCINSTALLDIR%includestdint.h"

  3. wKiom1l7Ht3As0GsAAAWuxt8dkg798.png-wh_50

  4. 重新安装pycrypto 2.6.1

    通过cmd进入pycrypto 2.6.1目录,执行python setup.py install

    wKiom1l7H0STYkyYAAAHm40lII4024.png-wh_50

  5. 结果如下所示:

    wKiom1l7H2CSSxxOAACZPVGXsMU409.png-wh_50

    成功安装pycrypto 2.6.1。。。。。。。

---------------

4,win10 安装"pip install orange3" 出现LINK : fatal error LNK1158: cannot run 'rc.exe' 错误的解决办法

解决办法:

从(本例使用的是64位的python3.6 注意:如果python的版本是32位,则使用x86;如果是64位,则使用x64;

复制一下两个文件

rc.exe  
rcdll.dll 


5.注意是Crypto还是crypto,区分大小写
我这里安装成功之后代码alt+enter自动关联的是

from crypto.Cipher import AES
1
然后代码运行报错,点进去AES里面import的是

from Crypto.Cipher import _AES

可以手动进入pythonLib下,我的路径是
C:Python36Libsite-packages
然后把文件夹crypto改成Crypto。把小写改成大写,刷新下,Finally
————————————————