2011-06-13 127 views
1

我使用yum在Centos VPS中安装了MySQLdb模块,它表示安装成功,不会产生错误。但是当我浏览python站点时,它显示错误。 “加载MySQLdb模块时出错:没有名为MySQLdb的模块”。详细的错误可以在http://74.53.127.172/看到。我也试图从压缩文件安装这个模块,但它会产生以下错误:python的MySQLdb模块安装问题

_mysql.c: In function â_mysql_ConnectionObject_get_proto_infoâ: 
_mysql.c:1633: error: â_mysql_ConnectionObjectâ has no member named âope  nâ 
_mysql.c:1634: warning: implicit declaration of function âmysql_get_prot  o_infoâ 
_mysql.c:1634: error: â_mysql_ConnectionObjectâ has no member named âcon  nectionâ 
_mysql.c: In function â_mysql_ConnectionObject_get_server_infoâ: 
_mysql.c:1648: error: â_mysql_ConnectionObjectâ has no member named âope  nâ 
_mysql.c:1649: warning: implicit declaration of function âmysql_get_serv  er_infoâ 
_mysql.c:1649: error: â_mysql_ConnectionObjectâ has no member named âcon  nectionâ 
_mysql.c:1649: warning: passing argument 1 of âPyString_FromStringâ make  s pointer from integer without a cast 
_mysql.c: In function â_mysql_ConnectionObject_infoâ: 
_mysql.c:1665: error: â_mysql_ConnectionObjectâ has no member named âope  nâ 
_mysql.c:1666: warning: implicit declaration of function âmysql_infoâ 
_mysql.c:1666: error: â_mysql_ConnectionObjectâ has no member named âcon  nectionâ 

回答

3

使用下面的命令来安装在CentOS的运行mysql顺利

>> yum install python-devel 
>> yum install MySQL-devel 
>> yum install zlib-devel 
>> yum install openssl-devel 

快乐coading :)

需要的其它包
0

尝试产卵一个python交互shell然后导入MySQLdb的,看看你得到同样的错误,在这种情况下,模块未成功安装。 尝试“找到mysqldb”并给我们输出。