错误提示信息如下
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
All I had to do was go over to oracle, and download the MySQL Connector C 6.0.2 (newer doesn't work!) and do the typical install.
https://downloads.mysql.com/archives/c-c/
Be sure to include all optional extras (Extra Binaries) via the custom install, without these it did not work for the win64.msi
Once that was done, I went into pycharms, and selected the MySQL-python>=1.2.4 package to install, and it worked great. No need to update any configuration or anything like that. This was the simplest version for me to work through.
The accepted solution no longer seems to work for newer versions of mysql-python. The installer no longer provides a site.cfg
file to edit.
If you are installing mysql-python it'll look for C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include
. If you have a 64-bit installation of MySQL, you can simply invoke:
mklink /d "C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" "C:\Program Files\MySQL\MySQL Connector C 6.0.2\include"
- Run
pip install mysql-python
- Delete the symbolic link created in step 1
reference: https://blog.csdn.net/bijiaoshenqi/article/details/44758055