Resolving "Cannot Open Include File 'config-win.h'" Error during MySQL-Python Installation
Encountering the "Cannot Open Include File: 'config-win.h'" error while installing mysql-python through pip can be frustrating. This article provides a comprehensive solution to address this issue.
Background:
This error often occurs on Windows machines when the Visual Studio C environment is not configured correctly. Despite installing Visual Studio C and attempting both 32-bit and 64-bit installations, the issue persists on certain systems.
Addressing the Error:
The solution varies depending on the Windows architecture:
For 64-bit Windows
pip install wheel
Download from Gohlke's Repository: Visit http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python and download the appropriate wheel file:
pip install mysqlclient-1.3.8-cp36-cp36m-win_amd64.whl
pip install mysqlclient-1.3.8-cp27-cp27m-win_amd64.whl
Notes:
Additional Troubleshooting:
By following these steps, you should be able to resolve the "Cannot Open Include File: 'config-win.h'" error and successfully install the mysql-python library on your Windows system.
The above is the detailed content of How Can I Fix the 'Cannot Open Include File 'config-win.h'' Error During MySQL-Python Installation on Windows?. For more information, please follow other related articles on the PHP Chinese website!