Windows7 Python-3.6 安装PyCrypto(pycrypto 2.6.1)出现错误以及解决方法

今天准备在Windows系统上基于python3.6安装一个pycrypto 2.6.1模块,很不幸的报了一堆错误,如下所示:

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.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/ -Isrc/inc-msvc/ -IC:\Python36\include -IC:\Python36\include

winrand.c

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(26): error C2061: syntax error: identifier ‘intmax_t‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(27): error C2061: syntax error: identifier ‘rem‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(27): error C2059: syntax error: ‘;‘

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

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

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(30): error C2059: syntax error: ‘;‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(40): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(41): error C2146: syntax error: missing ‘)‘ before identifier ‘_Number‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(41): error C2061: syntax error: identifier ‘_Number‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(41): error C2059: syntax error: ‘;‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(42): error C2059: syntax error: ‘)‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(45): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(46): error C2146: syntax error: missing ‘)‘ before identifier ‘_Numerator‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(46): error C2061: syntax error: identifier ‘_Numerator‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(46): error C2059: syntax error: ‘;‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(46): error C2059: syntax error: ‘,‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(48): error C2059: syntax error: ‘)‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(50): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(56): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(63): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(69): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(76): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(82): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.h(89): error C2143: syntax error: missing ‘{‘ before ‘__cdecl‘

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.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的环境变量,如图:

  2. 打开cmd,执行如下命令:set CL=/FI"%VCINSTALLDIR%\\INCLUDE\\stdint.h" %CL%

  3. 重新安装pycrypto 2.6.1

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

  4. 结果如下所示:

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

时间: 2024-08-25 02:26:07

Windows7 Python-3.6 安装PyCrypto(pycrypto 2.6.1)出现错误以及解决方法的相关文章

window10 安装出现the error code is 2503错误的解决方法

window10 安装出现the error code is 2503错误的解决方法: 设置 C:\WINDOWS\TEMP的权限

yum安装软件包时出现Transaction Check Error:错误的解决方法

[[email protected] ~]# yum install ipa-server Transaction Check Error:  file /usr/share/man/man3/XML::SAX::Base.3pm.gz conflicts between attempted installs of perl-XML-SAX-0.96-7.el6.noarch and perl-XML-SAX-Base-1.04-1.el6.rf.noarch  file /usr/share/

ORACLE安装过程中检查步骤出现的错误和解决方法【转】

Checking operating system requirements ...Expected result: One of redhat-3,redhat-4,SuSE-9,asianux-1,asianux-2Actual Result: redhat-4Check complete. The overall result of this check is: Passed==========================================================

redhat编译安装postfix-3.1.1出现的一些错误及解决方法

今天尝试在rhel5.8下编译安装postfix,在编译安装postfix-3.1.1时出现了些小问题,在此记录下,以备不时之需,同时希望可以帮助到遇到相同问题的朋友. 1.在make makefiles及make命令顺利完成并执行make install命令时,出现以下现象: 前两个选项提供默认值,其后的各选项都不再出现默认值,手动输入各选项的值最终还是报错:error while loading shared libraries: libmysqlclient.so.18: cannot o

python3.5.4安装时老是弹出api-ms-win-crt-runtime-|1-1-0.dll错误的解决方法

本来python安装的方法简单,只要安装前勾选添加到环境变量,然后继续安装就能成功,但是有些电脑安装总是会出这样或那样的问题. 我的电脑win7 64位的系统,之前系统是32位的,后面重装了一次系统,一开始的时候安装了一个32位的python3.5.4,安装完后提示api-ms-win-crt-process-l1-1-0.dll错误,于是在网 上下载了一个并注册,然鹅并没有解决问题. 因为我公司的电脑也是64位的,用的也是这个安装包,一下就安装好了,有点想不通,于是在python官网上下载了一

Windows 7 64bit上安装Oracle Database 12c [INS-30131] 错误的解决方法

Windows 7 64bit上安装Oracle Database 12c,出现以下错误: 解决方法: 第一步:控制面板>所有控制面板项>管理工具>服务>SERVER  启动 第二步:控制面板>所有控制面板项>管理工具>计算机管理>系统工具>共享文件夹>共享   右键单击“共享”>新建共享> 点击“下一步”>   单击“浏览”> 选择"本地磁盘(C:)">确定   单击“下一步”:     单击“

python安装locustio报错error: invalid command 'bdist_wheel'的解决方法

locust--scalable user load testing tool writen in Python(是用python写的.规模化.可扩展的测试性能的工具) 安装locustio需要的环境条件是:Python2.6+,但是不支持Python3. 今天在cmd里运行pip install locustio,报错提示:error: invalid command 'bdist_wheel'. 原因:pip和setuptools的版本较低. 解决方案:升级pip和setuptools. 一

Tesorflow源代码安装方式以及错误的解决方法

作者 修雨轩陈@cnblog 目录 Configure the installation. (安装配置) Create the pip package and install (创建pip安装包并且安装) ---------------- 参考文献: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md 软件环境: ubuntu 14,.04 –64bit pyt

安装postgreSQL出现configure:error:readline library not found解决方法

要安装 readline , readline-dev 开发包,要么使用 --without-readline 选项关闭 readline 功能. #yum install readline; #yum install readline-dev; readline 也就是命令行编辑,关闭的话,你直接用psql 就不能编辑命令行,如果输错指令,不能回滚命令历史记录,只能手工重新输入. 在安装postgreSQL的过程中遇到一个问题,在执行 configure 过程中报以下错误,configure:

fedora25 安装virtualbox5.1 出现提示Kernel driver not installed (rc=-1908) 错误的解决方法

fedora25 安装virtualbox5.1 出现提示Kernel driver not installed (rc=-1908) 错误的解决方法: $ sudo /usr/lib/virtualbox/vboxdrv.sh setup        vboxdrv.sh: Building VirtualBox kernel modules.             vboxdrv.sh: Starting VirtualBox services.