pip3 install pycryptohome

python3.6此库安装方式,需要pip3 install pycryptodome。

如有site-packages中存在crypto、pycrypto,

在pip之前,需要pip3 uninstall crypto、pip3 uninstall pycrypto,否则无法安装成功。

C:WINDOWSsystem32>pip3 install pycryptodome
Collecting pycryptodome
  Downloading https://files.pythonhosted.org/packages/0f/5d/a429a53eacae3e13143248c3868c76985bcd0d75858bd4c25b574e51bd4d/pycryptodome-3.6.3-cp36-cp36m-win_amd64.whl (7.9MB)
    100% |████████████████████████████████| 7.9MB 111kB/s
Installing collected packages: pycryptodome
Successfully installed pycryptodome-3.6.3

这里顺带说一下pycrypto,这个库已经有很久没有人维护了,如果需要安装此库,需要先安装 VC++ build tools

然后将 ~BuildToolsVCToolsMSVC14.15.26726include 目录下的 stdint.h 拷贝到 C:Program Files (x86)Windows Kits10Include10.0.17134.0ucrt 下。(Win10 需管理员权限)

接着将同目录下的 inttypes.h 中的 #include <stdint.h> (第十四行),改成 #include "stdint.h"。

然后使用 pip3 install pycrypto,就能直接安装了。

注:如果不是业务需要,请尽可能使用 pycryptodome。

L-Rui
原文地址:https://www.cnblogs.com/Rui6/p/14826751.html