mysql-python install error: Cannot open include file 'config-win.h'

Solution 1:

for 64-bit windows

  • install using wheel

    pip install wheel
    
  • download from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python

    For python 3.x:

    pip install mysqlclient-1.3.8-cp36-cp36m-win_amd64.whl
    

    For python 2.7:

    pip install mysqlclient-1.3.8-cp27-cp27m-win_amd64.whl
    

Solution 2:

This didn't work for me:

pip install mysqlclient

so I found this after a while on Stack Overflow:

pip install --only-binary :all: mysqlclient

and it went all through, no need for MS Visual C++ 14 Build tools and stuff.

Note: for now this doesn't work with Python 3.7, I also had to downgrade to Python 3.6.5.

Solution 3:

well this worked for me:

pip install mysqlclient

this is for python 3.x in window 7 i am not sure about other windows os versions

Solution 4:

I am using Windows 10 and overcame this issue by running the pip install mysql-connector command in Windows PowerShell rather than the Command Prompt.

Solution 5:

you can try to install another package:

pip install mysql-connector-python

This package worked fine for me and I got no issues to install.