安装插件报错error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++
起因:学到多线程greenlet模块时,greenlet模块死活装不上,以为pycharm坏掉了,浪费了一下午。
#pip3 install greenlet from greenlet import greenlet import time def eat(name): print('%s eat 1' % name) # time.sleep(1) g2.switch('egon') print('%s eat 2' % name) g2.switch() def play(name): print('%s play 1' % name) g1.switch() print('%s play 2' % name) g1 = greenlet(eat) g2 = greenlet(play) g1.switch('egon')
报错如下:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "e:softpython3.6_x64python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\RJ-TR19\AppData\Local\Temp\pip-build-q2fmqstd\pycrypto\setup.py';f=getattr(tokenize, 'open',
open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersRJ-TR19AppDataLocalTemppip-dchg89ka-recordinstall-record.txt --
single-version-externally-managed --compile" failed with error code 1 in C:UsersRJ-TR19AppDataLocalTemppip-build-q2fmqstdpycrypto
最后的pycrypto说明缺少该包,需要安装
解决办法:
下载Microsoft Visual C++ 14.0
右键以管理员身份运行,选择默认方式安装即可,电脑也不用重启,直接pip安装所需要的插件就行
地址:https://pan.baidu.com/s/18bjsvBIgBAhn5_6ApMcFew 密码: zkzf