2011-06-13 110 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」並給我們輸出。