pyhton3.7下安装pycrypto时出现错误

pyhton3.7下安装pycrypto时出现错误

在cmd中输入pip install pycrypto

error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualstudio.com/visual-cpp-build-tools

然后我在网上找到了visualcppbuildtools_full的安装包,这个包可以在不安装visual studio的情况下安装Visual C++ 14.0
再次运行pip install pycrypto,发现仍然发生错误:

Command “c:\users\lucky_yu\appdata\local\programs\python\python37\python.exe -u -c “import setuptools, tokenize;file=‘C:\Users\lucky_yu\AppData\Local\Temp\pip-install-my_yjsm9\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\lucky_yu\AppData\Local\Temp\pip-record-9eutt09x\install-record.txt --single-version-externally-managed --compile” failed with error code 1 in C:\Users\lucky_yu\AppData\Local\Temp\pip-install-my_yjsm9\pycrypto\

宝宝表示不开心!!!

之后去国外网站转了一圈,有歪果仁说可以用一下这个命令pip install --upgrade setuptools看看有没有用
结果,还是没有卵用,只能继续寻找,终于皇天不辜负有心人,我终于找到了最终的解决办法:用pycryptodome代替pycrypto,结果发现成功!,虽然还是不清楚怎么解决pycrypto安装不成功的问题,不过替代方案也不错!

你可能感兴趣的:(python学习)