Windows 10家庭中文版,Python 3.6.4,

180824测试前端加密文本在后台揭秘,查询后发现,可以使用pycrypto模块实现,那么,安装它(pip),结果安装失败了。

本文暂时记录下失败的日志,后面找到解决问题了再完善博文。

pycrypto相关网址:

PyPI:https://pypi.org/project/pycrypto/

官网:https://www.dlitz.net/software/pycrypto/

官文:https://www.dlitz.net/software/pycrypto/api/current/

使用pip list,没有找到pycrypto,那么,安装它。

>pip3 install pycrypto

下面是安装过程日志中的部分错误信息:

...

Running setup.py bdist_wheel for pycrypto ... error
Complete output from command c:\python36\python3.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\log\\AppData\\Local\\Temp\\pip-install-0e9wj35t\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\log\AppData\Local\Temp\pip-wheel-i1adunc1 --python-tag cp36:
...
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
...
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 "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc/winrand.c /Fobuild\temp.win-amd64-3.6\Release\src/winrand.obj
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(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
...
----------------------------------------
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
Complete output from command c:\python36\python3.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\log\\AppData\\Local\\Temp\\pip-install-0e9wj35t\\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\log\AppData\Local\Temp\pip-record-ux9dvuso\install-record.txt --single-version-externally-managed --compile:
running install
...
build\lib.win-amd64-3.6\Crypto\Signature
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
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 "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc/winrand.c /Fobuild\temp.win-amd64-3.6\Release\src/winrand.obj
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: '}'
...
----------------------------------------
Command "c:\python36\python3.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\log\\AppData\\Local\\Temp\\pip-install-0e9wj35t\\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\log\AppData\Local\Temp\pip-record-ux9dvuso\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\log\AppData\Local\Temp\pip-install-0e9wj35t\pycrypto\
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

----END----

从上面的错误日志来看,需要用到一个cl.exe命令,这个命令的路径存在于Microsoft Visual Studio 14.0或Windows Kits中,但是,孤的电脑上是没有的。

解决的方法当然是安装Microsoft Visual Studio,参考链接的解决方法也是说要安装一个,不过更详细一些。

另外,错误日志还提示GMP or MPIR library缺失,是否安装好Microsoft Visual Studio就有了呢?然后,之后就可以安装pycrypto了。

接下来,分为两步解决这个问题:

1.安装Microsoft Visual Studio;

2.安装pycrypto(此步骤的日志可以检查GMP or MPIR library是否已经有了,若是没有,且pycrypto安装失败,那么再找办法);

0825-0900新发现:

孤的电脑已经有错误日志中提到的Microsoft Visual Studio 14.0或Windows Kits目录及相关文件了,可是看来,上面说的解决方法是不对的,还需要继续dig才是

操作系统模块安装了Visual Studio 2015的部分功能吗?下图的这些是怎么来的呢?

既然如此,那么,又要怎么解决呢?再看看参考链接吧!

去Visual Studio官网看了一遍,好多软件,不愧是Microsoft!对于一位非Windows系程序员,要选对软件有些困难啊!

还要找找,到底Windows 10上能否安装pycrypto!

哎呀,都要耗费精时啊!

检查Python标准库,居然没有找到加密、安全相关的模块,搜索security、crypto都没有找到想要的——使用各种加密算法,看来,必须要用第三方库了,比如pycrypto。

参考链接:

windows 下的python 安装pycrypto by 园友 anne的夏天

python 加密解密 by 园友 jihite

0825-0930更新:哇哦,Ubuntu(18.04)上安装pycrypto好方便啊!嗖的一下就安装好勒!

安装好了,可是,import pycrypto失败!

>>> import pycrypto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pycrypto'

疑问:怎么找到一个模块的用法呢?官网吗?通过模块本身可以知道吗?

参考下面的链接(官文)可以初步知道pycrypto模块的用法:

Python Cryptography Toolkit

转载于:https://www.cnblogs.com/luo630/p/9532924.html

Windows安装pycrypto失败记录相关推荐

  1. Mac air装 win10 ,总是提示拷贝windows安装文件失败!?

    遇到问题 最近给macbook装win10的时候,突然遇到总是提示拷贝windows安装文件失败,如下: 这是为什么呢? 答案参考:https://www.zhihu.com/question/304 ...

  2. windows安装fis-sass失败

    windows安装fis-sass失败 最近在使用fis3, 团队遇到各种安装问题, 归纳如下: 1. 先确保安装了vs2015 community, https://www.visualstudio ...

  3. windows安装Twisted失败

    windows安装Twisted失败 傻瓜方法 Twisted-20.3.0-cp39-cp39-win_amd64' looks like a filename, but the file does ...

  4. 安装PyCrypto失败

    之前安装PyCrypto包一直提示失败,并且报如下错误: 针对以上错误解决如下: step 1. 我的电脑安装了VisualStudio2017,所以去VisualStudio的安装目录将stdint ...

  5. Windows安装PyCrypto

    python3安装PyCrypto的一大串错误就不贴了. 但是可以先更新下pip:python -m pip install --upgrade pip 如果安装过程中,导致pip安装失败,使用pip ...

  6. UBUNTU下面安装ICE失败记录过程

    ICE是ZEROC的开源通信协议产品,它的全称是:The Internet Communications Engine,翻译为中文是互联网通信引擎,是一个流行的面向对象的工具包,使我们能够以最小的代价 ...

  7. Windows安装Scoop失败解决方法

    一.打开Windows Powershell 如果不知道怎么打开,点这  https://zhinan.sogou.com/guide/detail/?id=316513294056 二.安装 在Po ...

  8. Windows安装PyCrypto库包

    PyCrypto是使用Python编写的加密工具包,很多脚本中经常会用到.所以我们有必要安装它.但是,在Windows下使用pip install pycrypto进行安装的时候,经常会报错. 为了解 ...

  9. 缺少mdmcpq驱动文件非原版Windows安装驱动失败“该设备的驱动程序未被安装。(代码 28)”错误

    1.故障现象 在给单位的一台Server2008R2 X64服务器上安装扫描枪的时候发现无法安装扫描枪驱动,打开设备管理器可以看到扫描枪硬件有黄色叹号标记.错误信息如下: Windows给出的错误提示 ...

最新文章

  1. 如何找回丢失的Vista系统“休眠”菜单
  2. Ubuntu查看端口占用情况
  3. 阿里云 MSE 云原生网关助力斯凯奇轻松应对双 11 大促
  4. HDU - 5015 233 Matrix(矩阵快速幂)
  5. css----实现checkbox图片切换
  6. UE4异步编程专题 - 线程池FQueuedThreadPool
  7. mysql高可用性方案(2)
  8. HTTP请求报文格式与HTTP2.0
  9. 智慧社区管理类毕业论文文献不好找?
  10. linux微软公式编辑器,linux下的公式编辑器
  11. 情人节满屏爱心HTML5特效(表白源码html+css)
  12. 苏州大学在职研究生计算机专业,苏州大学在职研究生有哪些专业?
  13. 雪球网基于沪深300的评论爬虫
  14. 模数转换器(ADC)的几种主要类型简介
  15. eeprom--24LC64
  16. Android拖动实现(一个流畅的拖动排序DragSortGridView,自动滚屏)
  17. 学习笔记之——基于深度学习的目标检测算法
  18. 小米MIUI 360wifi掉线解决方案 落雨
  19. 离散题目10(判断是否为满射函数 )
  20. 关于cmd中路径包含空格的解决办法

热门文章

  1. python汉字转拼音代码_python3实现汉字转拼音
  2. 云计算及Openstack云平台技术图解
  3. 梦幻新任务副本系统,跑环日常副本成就任你选!
  4. ps字体怎么安装?Photoshop CS6安装字体图文教程
  5. 联想ThinkServer RD640 服务器做RAID 5
  6. c语言画枪,基于51单片机的玩具枪打靶设计-数码管-KEY-激光-WT588D-(电路图+程序源码)...
  7. WireShark(1)
  8. 挠性印制电路板(FPC)和刚挠结合印制电路板
  9. lisp 圆柱螺旋线_AUTOCAD中的螺旋线怎么画?(椭圆的上下两面圆的不同象限点如何在椭圆表面用曲线连接)...
  10. python之mean函数,计算多维