关于windows在pycharm下安装关于mysql的模块

pycharm 版本为2018版,python为3.7。安装Python-mysql中,具体模块为mysql报错如下(只选取了报错部分):

Proposed solution:

Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'D:\pycharmP\python\mysql_python\venv\Scripts\python.exe'.

Command output:

warning: build_py: byte-compiling is disabled, skipping.

_mysql.c(42): fatal error C1083: 无法打开包括文件: “config-win.h”: No such file or directory
error: command 'D:\\vs2015\\VC\\BIN\\cl.exe' failed with exit status 2

之后尝试过,降低pip版本,降低Python版本,解释器重新设置,然而并无任何效果。

https://blog.csdn.net/wang1472jian1110/article/details/71212740博客中有关于Python2.7与mysql的链接,

但是没有新版本的Python3的方法,事实证明在Windows下安装Python库还是比较麻烦,

功夫不负有心人,实际关于mysql的包不只有mysql一个,例如mysqldb-rich,mysqldbda等,但是这些依旧不能安装。

在博客https://blog.csdn.net/just_so_so_fnc/article/details/72995731中提到使用PyMySQL,结果安装成功,可以正常使用。同时PyMysqlDB也可以正常安装。具体如下:关于windows在pycharm下安装关于mysql的模块

关于windows在pycharm下安装关于mysql的模块

 关于windows在pycharm下安装关于mysql的模块