无法在virtualenv中安装mySQL-python

 手机用户2502896697 发布于 2022-12-11 10:21

当我尝试在virtualenv(pip install MySQL-python)中安装MySQL-python时,我收到以下错误(截断到最后几行)

_mysql.c: At top level:
_mysql.c:2551: error: ‘_mysql_ConnectionObject’ has no member named ‘open’    
_mysql.c:2558: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’    
_mysql.c:2565: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’    
_mysql.c:2572: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’   
_mysql.c:2579: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’   
_mysql.c:2642: error: ‘_mysql_ResultObject’ has no member named ‘converter’  
_mysql.c:2642: error: initializer element is not constant
_mysql.c:2642: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)    
_mysql.c: In function ‘_mysql_ConnectionObject_getattr’:    
_mysql.c:2666: error: ‘_mysql_ConnectionObject’ has no member named ‘open’

error: command 'gcc' failed with exit status 1

谷歌搜索告诉我,我需要安装python-devel,但是当我跑步时,yum install python-devel我得到了

Package python-devel-2.6.6-52.el6.x86_64 already installed and latest version
Nothing to do

我在安装了python 2.6和2.7的CentOS 6.5机箱上.我在virtualenvs中使用python 2.7.我跑的时候激活了virtualenv pip install mySQL-python.

我试过运行yum install python-develvirtualenv激活和停用,它两次都给出"已安装"消息.

这是否意味着python 27安装没有得到python-devel安装?

另一个线程建议尝试yum install mysql-devel.x86_64,虽然这给了

Resolving Dependencies
--> Running transaction check
---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be installed
--> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-devel-5.1.73-3.el6_5.x86_64
--> Finished Dependency Resolution
Error: Package: mysql-devel-5.1.73-3.el6_5.x86_64 (base)
           Requires: mysql = 5.1.73-3.el6_5
           Installed: mysql-5.5.40-1.el6.remi.x86_64 (@remi)
               mysql = 5.5.40-1.el6.remi
           Available: mysql-5.1.73-3.el6_5.x86_64 (base)
               mysql = 5.1.73-3.el6_5
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

(使用--skip-broken不起作用,它只是跳过它)

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有