美文网首页
python3 安装 pycrypto

python3 安装 pycrypto

作者: 东京的雨不会淋湿首尔 | 来源:发表于2017-09-11 20:20 被阅读307次

先说windows吧

先尝试了pip installe 等无果后。。。
在官网下载pycrypto安装包zip
解压。。。
python setup.py install
报错:

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

上网找到解决办法如下:
1.找到自己vs安装目录里的VC,复制路径,添加用户环境变量

image.png

2.打开cmd ,进入虚拟环境(没有的话不用)
输入

set CL=/FI"%VCINSTALLDIR%\\INCLUDE\\stdint.h" %CL%

3.重新执行
python setup.py install
尝试在pycharm的terminal中执行,结果还是报错。最终在cmd 中成功安装~

再说linux

要装个
apt-get installe python-dev

相关文章

网友评论

      本文标题:python3 安装 pycrypto

      本文链接:https://www.haomeiwen.com/subject/oyofsxtx.html