A-A+

win10 python3 解决 error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools “

2019年03月24日 15:56 学习笔记 暂无评论 共1376字 (阅读3,835 views次)

【注意:此文章为博主原创文章!转载需注意,请带原文链接,至少也要是txt格式!】

今天在安装python3的某个插件库的时候,报错了,然后莫名的pip就没了,很是费解!!!
先说一下,看到网上有人说用python -m pip install --upgrade pip
这个命令,其实pip已经莫名的不存在了,这个命令根本用不了,只有去官网下载同样的版本,然后更新一下。

言归正传,说一下 error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools "的解决方法,我是在安装

pip install flask-simpleldap

然后系统报错:

    copying Lib\slapdtest\certs\server.pem -> build\lib.win32-3.7\slapdtest\certs
    running build_ext
    building '_ldap' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools
": https://visualstudio.microsoft.com/downloads/

    ----------------------------------------
Command "e:\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\
\admin\\AppData\\Local\\Temp\\pip-install-3hfu5gg2\\python-ldap\\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\admin\AppData\Local\Temp\pip-record-8gm90dg_\install-re
cord.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ad
min\AppData\Local\Temp\pip-install-3hfu5gg2\python-ldap\

网上找了很多方法,大多数都说去微软官网下载visualstudio,但是这个程序好大,非常占用空间。
我的解决方法是,首先去https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap 在这里找到你对应的库。例如我需要的库是flask-simpleldap,我就找到了https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap ,然后我的系统是windows10 64位的,我就安装了。python_ldap-3.2.0-CP37-cp37m-win32.whl 这个,当安装完这个之后,我再次安装pip install flask-simpleldap 就成功安装完毕啦。

布施恩德可便相知重

微信扫一扫打赏

支付宝扫一扫打赏

×
标签:

给我留言