1.問題記錄
> pip install -i https://pypi.douban.com/simple mysqlclient
Looking in indexes: https://pypi.douban.com/simple
Collecting mysqlclient
Using cached https://pypi.doubanio.com/packages/50/5f/eac919b88b9df39bbe4a855f136d58f80d191cfea34a3dcf96bf5d8ace0a/mysqlclient-2.1.1.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
MySQ
......
Ldb/_mysql.c(29): fatal error C1083: 無法打開包括文件: “mysql.h”: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1:
2.解決方案
直接下載安裝mysqlclient whl文件進行安裝
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
注意:cp37即表示python3.7的版本,其他版本號同理,win32表示windows 32位的, win_amd64表示windows 64位
我這里是python3.7的版本,系統(tǒng)是64位所以選擇mysqlclient?1.4.6?cp37?cp37m?win_amd64.whl
文章來源:http://www.zghlxwxcb.cn/news/detail-673321.html
結果如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-673321.html
(venv) E:\project\xxx\service>pip install mysqlclient-1.4.6-cp37-cp37m-win_amd64.whl
Processing e:\project\xxx\service\mysqlclient-1.4.6-cp37-cp37m-win_amd64.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.4.6
到了這里,關于windows環(huán)境 pip安裝mysqlclient失敗問題記錄及解決方案的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!