Python3.5下安装MySQL-python


[plain]  view plain  copy
  1. mysql.c(42): fatal error C1083: 无法打开包括文件: “config-win.h”: No such file or directory  
  2. error: command 'D:\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 

又找了很长时间,终于找到适合在Python-3.5上扩展的mysql驱动

https://pypi.python.org/pypi/mysqlclient/1.3.10

这是目前的最新版本(截止至2017.07.15),之后若有最新版本也可在上面那个页面跳转

然后用cmd命令进入到这个目录执行PIP命令安装:

[plain]  view plain  copy
  1. pip install xxxx.whl  
这里自己将xxxx.whl改为下载下来的文件名,注意whl文件名不能改,必须和原名一模一样

安装后就会提示Successfully installed mysqlclient-1.3.10

检查MySQLdb模块是否可以正常导入来测试有没有安装成功:

[python]  view plain  copy
  1. import MySQLdb  

没有报错提示MySQLdb模块找不到,说明安装成功!

猜你喜欢

转载自blog.csdn.net/qq_24651739/article/details/80618567
今日推荐