安装mysql-python之前, 请先安装setuptools. https://pypi.python.org/pypi/setuptools/7.0
下载mysql-python. 下载源码包. https://pypi.python.org/pypi/MySQL-python/1.2.5
解压后执行 python setup.py install
提示错误: fatal error C1083: Cannot open include file: ‘config-win.h‘: No such file or directory
需要安装mysql connector 前往 http://dev.mysql.com/downloads/connector/c/6.0.html#downloads 根据python的版本下载32位或64位版本. 默认安装即可.
再次执行 python setup.py install 安装成功.
如果还出现相同的错误, 请检查文件site.cfg 中connector 的值是否是你安装mysql connector的目录. 默认应该是 C:\Program Files(x86) \MySQL\MySQL Connector C 6.0.2 (32位) 或 C:\Program Files\MySQL\MySQL Connector C 6.0.2 (64位)
修改为你安装的目录即可.
mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
时间: 2024-10-02 10:30:12