windows10安装mysql-python报错处理

running build_ext
    building '_mysql' extension
    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
 _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
    error: command '"C:\Users\54901\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2

以上报错都是在执行pip install mysql-python==1.2.5时报的。

 

第一次执行pip install时,报了第一个错误,我安装了vcpython27.msi。

下载地址为:https://sx.guiren21.com/201802/tools/VCForPython27_jb51.rar

这个地址可能失效,到时候你直接百度即可。

 

第二次执行pip install时,报了第二个错误,于是放弃采用远程安装,而是直接下载whl文件来安装。

下载地址:

https://download.lfd.uci.edu/pythonlibs/a4hvik9m/cp27/MySQL_python-1.2.5-cp27-none-win_amd64.whl

如果该链接失效,请到https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python,这个地址去手动下载。

 

下载whl文件之后,手动安装:pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl

 

此时就代表安装成功了。

 

posted @ 2022-06-20 11:14  道霖  阅读(356)  评论(0编辑  收藏  举报