python安装第三方库报错:Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”

安装Python第三方库mysqlclient,通过 pip install mysqlclient 命令安装时,提示
ERROR:Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools
解决办法:进入下方网址
https://www.lfd.uci.edu/~gohlke/pythonlibs/
按CTRL+F弹出搜索框,输入mysqlclient
选择需要的文件,如何确定需要的文件?

>>>import pip._internal
>>>print(pip._internal.pep425tags.get_supported())
[('cp38', 'cp38m', 'win_amd64'), ('cp38', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('cp38', 'none'
, 'any'), ('cp3', 'none', 'any'), ('py38', 'none', 'any'), ('py3', 'none', 'any'), ('py37', 'none', 'any'), (
'py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', '
none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]

注意第一个括号,从上面网址下载下来的包,
很可能需要改名,否则会出现

mysqlclient-1.4.6-cp38-**cp38**-win_amd64.whl is not a supported wheel on this platform.

改为如下及安装:

mysqlclient-1.4.6-cp38-**cp38m**-win_amd64.whl
发布了10 篇原创文章 · 获赞 2 · 访问量 5259

猜你喜欢

转载自blog.csdn.net/qq_36686441/article/details/104298699
今日推荐