• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

安装MySQL-python有关问题解决_mysql

mysql 搞代码 7年前 (2018-06-07) 193次浏览 已收录 0个评论

安装mysql-python问题解决

今天在centos安装MySQL-python,结果报错,报错信息如下:

    Running command /home/yunpeng.jiangyp/sys/python/bin/python -c "import setuptools;__file__='/home/admin/jyp/build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('/r/n', '/n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-MH5Aya-record/install-record.txt     running install     running build     running build_py     copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb     running build_ext     building '_mysql' extension     gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/home/yunpeng.jiangyp/sys/python/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv     _mysql.c:44:23: error: my_config.h: No such file or directory     _mysql.c:46:19: error: mysql.h: No such file or directory     _mysql.c:47:26: error: mysqld_error.h: No such file or directory     _mysql.c:48:20: error: errmsg.h: No such file or directory     _mysql.c:88: error: expected specifier-qualifier-list before ‘MYSQL’     _mysql.c:102: error: expected specifier-qualifier-list before ‘MYSQL_RES’ 

 

google找到答案(http://stackoverflow.com/questions/13044201/install-mysql-python-return-error-in-centos),需要先安装mysql-devel.x86_64,通过

sudo yum install mysql-devel.x86_64

 

再次安装成功

[yunpeng.jiangyp@v010105 ~]$ pip install MySQL-python Downloading/unpacking MySQL-python   Running setup.py egg_info for package MySQL-python      Installing collected packages: MySQL-python   Running setup.py install for MySQL-python     building '_mysql' extension     gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/home/yunpeng.jiangyp/sys/python/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv     gcc -pthread -shared build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64/mysql -L/usr/lib64 -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -lssl -lcrypto -o build/lib.linux-x86_64-2.7/_mysql.so      Successfully installed MySQL-python Cleaning up... 

 

 

 

欢迎大家阅读《安装MySQL-python有关问题解决_mysql》,跪求各位点评,by 搞代码


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:安装MySQL-python有关问题解决_mysql

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址