我们配置好python环境之后想用mysql数据库时候会出现如下问题,在win系统下使用:pip install mysql-python会出现如下错误:
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27
解决办法:按上面提示到http://aka.ms/vcpython27下载安装后执行VCForPython27.msi。安装完成可能再次运行pip install mysql-python又出现一个错误如下:
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':
No such file or directory
error: command 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Common\\
Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit
status 2
解决的方法是在下面链接中下载MySQL-python_jb51net.rar