python的MySQLdb模块安装问题
我使用 yum 在 centos VPS 中安装了 MySQLdb 模块,它说已成功安装,没有产生任何错误。但是当我浏览 python 站点时它显示错误。 “加载 MySQLdb 模块时出错:没有名为 MySQLdb 的模块”。有关错误的详细信息,请访问 http://74.53.127.172/。我还尝试从压缩文件安装此模块,但它产生以下错误:
_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â
I installed MySQLdb module in centos VPS using yum and it says successfully installed producing no error. but when I browse the python site it displays the error. "Error loading MySQLdb module: No module named MySQLdb". Details of the error can be seen at http://74.53.127.172/. I also tried to install this module from the zipped file but it produces following error:
_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â
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用以下命令安装在centos中顺利运行mysql所需的其他软件包
快乐编码:)
use the following command to install other packages required to run mysql in centos smoothly
Happy coading :)
尝试生成一个 python 交互式 shell,然后导入 MySQLdb 并查看是否出现相同的错误,在这种情况下,模块未成功安装。
尝试“locate mysqldb”并给我们输出。
Try spawning a python interactive shell then import MySQLdb and see if you get the same error, in which case the module was not successfully installed.
Try "locate mysqldb" and give us the output .