‘gcc’ 失败,退出状态为 1 - MySQL-python-1.2.3

‘gcc’ 失败,退出状态为 1 - MySQL-python-1.2.3

我正在为 python2.6 安装 MySQL db。我从这里但当我在线上

我提取了文件,然后

python2.6 setup.py build

它给出了很多错误和警告,并以以下几行结束

_mysql.c: At top level:
_mysql.c:2331: error: â_mysql_ConnectionObjectâ has no member named âopenâ
_mysql.c:2338: error: â_mysql_ConnectionObjectâ has no member named âconverterâ
_mysql.c:2345: error: â_mysql_ConnectionObjectâ has no member named âconnectionâ
_mysql.c:2352: error: â_mysql_ConnectionObjectâ has no member named âconnectionâ
_mysql.c:2359: error: â_mysql_ConnectionObjectâ has no member named âconnectionâ
_mysql.c:2422: error: â_mysql_ResultObjectâ has no member named âconverterâ
_mysql.c:2422: error: initializer element is not constant
_mysql.c:2422: error: (near initialization for â_mysql_ResultObject_memberlist[0].offsetâ)
_mysql.c: In function â_mysql_ConnectionObject_getattrâ:
_mysql.c:2444: error: â_mysql_ConnectionObjectâ has no member named âopenâ
error: command 'gcc' failed with exit status 1

编辑

命令

# yum --enablerepo=smartfile install MySQL-python26

它说

 perl-DBD-MySQL-3.0007-2.el5.x86_64 from installed has depsolving problems
--> Missing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by   package perl-DBD-MySQL-3.0007-2.el5.x86_64 (installed)
 php-mysql-5.1.6-27.el5_5.3.x86_64 from installed has depsolving problems
--> Missing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by package php-mysql-5.1.6-27.el5_5.3.x86_64 (installed)
 mysql-5.0.77-4.el5_6.6.i386 from base has depsolving problems
--> mysql conflicts with MySQL-server
 php-mysql-5.1.6-27.el5_5.3.x86_64 from installed has depsolving problems
 --> Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package php-mysql- 5.1.6-27.el5_5.3.x86_64 (installed)
 perl-DBD-MySQL-3.0007-2.el5.x86_64 from installed has depsolving problems
 --> Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package perl-DBD-  MySQL-3.0007-2.el5.x86_64 (installed)
 MySQL-python-1.2.1-1.x86_64 from installed has depsolving problems
--> Missing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) is needed by package MySQL-python-1.2.1-1.x86_64 (installed)
 MySQL-python-1.2.1-1.x86_64 from installed has depsolving problems
 --> Missing Dependency: libmysqlclient_r.so.15()(64bit) is needed by package MySQL-   python-1.2.1-1.x86_64 (installed)
 Error: Missing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) is needed by package MySQL-python-1.2.1-1.x86_64 (installed)
 Error: Missing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by package perl-DBD-MySQL-3.0007-2.el5.x86_64 (installed)
 Error: Missing Dependency: libmysqlclient_r.so.15()(64bit) is needed by package MySQL-python-1.2.1-1.x86_64 (installed)
 Error: Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package php-mysql-5.1.6-27.el5_5.3.x86_64 (installed)
 Error: mysql conflicts with MySQL-server
 Error: Missing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by package php-mysql-5.1.6-27.el5_5.3.x86_64 (installed)
 Error: Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package perl-DBD-MySQL-3.0007-2.el5.x86_64 (installed)

但当我找到 sqlclient 时,我得到了

[root@domain ~]locate libmysqlclient
/usr/lib64/mysql/libmysqlclient.so.15
/usr/lib64/mysql/libmysqlclient.so.15.0.0
/usr/lib64/mysql/libmysqlclient_r.so.15
/usr/lib64/mysql/libmysqlclient_r.so.15.0.0

我如何提供此链接? 编辑2

命令

 [root@domain /]# yum whatprovides libmysqlclient.so.15

 Loaded plugins: fastestmirror
 Loading mirror speeds from cached hostfile
 * base: mirror.steadfast.net
 * epel: mirror.steadfast.net
 * extras: mirror.wiredtree.com
 * updates: mirror.wiredtree.com
   base             | 1.1 kB     00:00
   chl              |  951 B     00:00
   chl-source       |  951 B     00:00
   epel             | 3.7 kB     00:00
   epel/primary_db  | 3.8 MB     00:00
   extras           | 2.1 kB     00:00
   smartfile        |  951 B     00:00
   updates          | 1.9 kB     00:00
   mysql-5.0.77-4.el5_6.6.i386 : MySQL client programs and shared libraries
   Repo        : base
   Matched from:
   Other       : libmysqlclient.so.15

编辑3

[root@domain ~]# rpm -qa | grep -i mysql

产量

mysql-5.0.77-4.el5_6.6
mysql-server-5.0.77-4.el5_6.6
mysql-devel-5.0.77-4.el5_6.6
perl-DBD-MySQL-3.0007-2.el5
php-mysql-5.1.6-27.el5_5.3

表示 mysql 和 mysql-server 都是同一版本。

答案1

如果你使用智能文件repo,那么为什么不从那里安装 MySQL-python:

# yum --enablerepo=smartfile install MySQL-python26

相关内容