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
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 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' ]
...
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
Configuring So That Pip Install Can Work from Github
Pyspark: Split Multiple Array Columns into Rows
How to Fix "Importerror: No Module Named ..." Error in Python
How to Display a Pandas Data Frame with Pyqt5/Pyside2
Accessing Every 1St Element of Pandas Dataframe Column Containing Lists
Make Requests Using Python Over Tor
Regular Expressions: Search in List
Get Previous Row's Value and Calculate New Column Pandas Python
Sum of List of Lists; Returns Sum List
Super() Raises "Typeerror: Must Be Type, Not Classobj" for New-Style Class
Mysql-Python Install Error: Cannot Open Include File 'Config-Win.H'
Python Accessing Nested JSON Data
Should I Call Close() After Urllib.Urlopen()
Query for List of Attribute Instead of Tuples in SQLalchemy
How to Dynamically Load a Python Class