mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h' 非权威指南
来源:互联网 发布:生化奇兵 海葬 知乎 编辑:程序博客网 时间:2024/06/06 15:45
吐槽一下python,在python上对mysql直接进行操控套用一个包就行了:
pip install mysql-python
but...报错!
无论你用
pip install mysqlclient
也还是报错!
错误内容是:
error: command 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status2 ----------------------------------------Command "e:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\admini~1\\appdata\\local\\temp\\pip-build-sdlcxk\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\admini~1\appdata\local\temp\pip-fpt2zq-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\admini~1\appdata\local\temp\pip-build-sdlcxk\mysqlclient\
我测试的环境是windows7-b4bit
不过,跟系统的关系不大,主要是我的python是64bit的
不过,就算你换成了32bit的python仍然用不上上面的两条命令,这是因为上面那两条命令都是对linux服务的,windows不可以直接这么用,需要安装一个驱动
https://pypi.python.org/pypi/MySQL-python/
在上面就可以下载了,安装这个就可以了 MySQL-python-1.2.5.win32-py2.7.exe (md5)
但是!你的python环境需要是32bit的,而且这个对windows的驱动,好像对python3还不是很好,建议大家平时在PC上安装两个版本的python,
到时候更改环境变量来回切换用就行了。
说说另一种解决方法吧,嫌麻烦就不要看了,非常折腾:
上面的mysql-python我们尝试下载源代码,自己用python setup.py install 编译
源代码在pypi.python.org下载,自己在上面搜索就行了
这里面要注意,需要你下载一个mysql connector for C 的!注意是for C!
然后,记下来这个connector 的安装路径,默认是 :
C:\Program Files\MySQL 文件夹中,这是64位的,32位同理在x86中
然后,在下载的mysql-python源代码中,更改site.cfg文件!!!
在最后,我的是
connector = C:\Program Files\MySQL\MySQL Connector C 6.1
然后,编译还是失败,因为,你还要下载 ffmpeg 库,因为这里安装失败是因为源代码是给Linux gcc写的,默认Linux是有这些头文件的,但是在vc中是缺少的,需要将缺少的
头文件补充出来,缺哪个补哪个,慢慢补充好了,就OK了。。。
- mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h' 非权威指南
- win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': N
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':问题的解决
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':问题的解决
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':问题的解决
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':问题的解决
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':no such file or directory
- 安装pymysql、mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h':
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- win7 64 安装mysql-python:fatal error C1083: Cannot open include file: 'config-win.h': No such file or
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- Windows使用pip安装MySQL-python报错fatal error C1083: Cannot open include file: 'config-win.h'
- fatal error C1083: Cannot open include file: 'qwtplot.h':
- fatal error C1083: Cannot open include file
- fatal error C1083: Cannot open include file:
- mysql-python 安装错误: Cannot open include file: 'config-win.h': No such file or directory
- xdebug在linux下的安装教程
- HTML5第六课时,margin外边距
- Hopper Disassembler基础使用-iOS逆向工程
- 有关linux的继续学习
- matlab绘制49*49的二维矩阵曲线图
- mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h' 非权威指南
- CToolTipCtrl 两种用法
- 使用myeclipse上传项目到GitHub时发生master: master [rejected
- 欢迎使用CSDN-markdown编辑器
- 题目1151:位操作练习
- 快速幂取模算法【模板】
- SpringMVC 基于注解的Controller详解
- HTML5第六课时,padding内边距
- linux目录为树结构