"Cannot Open Include File: 'Config-Win.H': No Such File or Directory" While Installing MySQL-Python

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

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

Cannot open include file: 'config-win.h': No such file or directory while installing mysql-python

Update for mysql 5.5 and config-win.h not visible issue

In 5.5 config-win. has actually moved to Connector separate folder in windows. i.e. smth like:

C:\Program Files\MySQL\Connector C 6.0.2\include

To overcome the problem one need not only to download "dev bits" (which actually connects the connector) but also to modify mysqldb install scripts to add the include folder. I've done a quick dirty fix as that.

site.cfg:

# Windows connector libs for MySQL.
connector = C:\Program Files\MySQL\Connector C 6.0.2

in setup_windows.py locate the line

include_dirs = [ os.path.join(mysql_root, r'include') ]:

and add:

include_dirs = [ os.path.join(options['connector'], r'include') ]

after it.

Ugly but works until mysqldb authors will change the behaviour.


Almost forgot to mention. In the same manner one needs to add similar additional entry for libs:

library_dirs = [ os.path.join(options['connector'], r'lib\opt') ]

i.e. your setup_windows.py looks pretty much like:

...
library_dirs = [ os.path.join(mysql_root, r'lib\opt') ]
library_dirs = [ os.path.join(options['connector'], r'lib\opt') ]
libraries = [ 'kernel32', 'advapi32', 'wsock32', client ]
include_dirs = [ os.path.join(mysql_root, r'include') ]
include_dirs = [ os.path.join(options['connector'], r'include') ]
extra_compile_args = [ '/Zl' ]
...

python - _mysql Cannot open include file: 'config-win.h': No such file or directory when installing mysql-python

i know this question is dirt old but the soloution is:
installing vs2010 and then installing and it will install without problems!
edit:
you can use official mysql connector for python.it can be easily downloaded from here for all platforms!

Cannot install mysqlcient: Cannot open include file: 'mysql.h'

You are missing the mysql headers which you should install through mysql client connector installer.

Easier way would be just to install it through wheel, it should automatically use the official wheel if your python is x64 version but you can download and install unofficial compiled wheel ( you should chose download for your version of python (3.8 x86?) and install it using)

pip install some-package.whl

pip install mysqlclient returns fatal error C1083: Cannot open file: 'mysql.h': No such file or directory

You can download unofficial windows binaries for your python version using https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient. Then install it using pip. This way you'll be able to avoid the hassle of dealing with visual studio build tools.

Just download the mysqlclient.whl file most applicable to you. I think in your case it'll be

mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl

and run

pip install "path to the downloaded .whl file"


Related Topics



Leave a reply



Submit