首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python的MySQLdb模块安装问题

问python的MySQLdb模块安装问题
EN

Stack Overflow用户
提问于 2011-06-13 21:53:45
回答 2查看 1.1K关注 0票数 1

我使用yum在centos VPS中安装了MySQLdb模块,它显示安装成功,没有产生错误。但是当我浏览python站点时,它显示错误。“加载MySQLdb模块时出错:没有名为MySQLdb的模块”。有关该错误的详细信息,请访问http://74.53.127.172/。我还试图从压缩文件中安装此模块,但它产生了以下错误:

代码语言:javascript
复制
_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â
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-06-14 01:21:16

使用以下命令安装在centos中流畅运行mysql所需的其他包

代码语言:javascript
复制
>> yum install python-devel
>> yum install MySQL-devel
>> yum install zlib-devel
>> yum install openssl-devel

快乐划船:)

票数 3
EN

Stack Overflow用户

发布于 2011-06-13 22:51:34

尝试生成一个python交互式外壳,然后导入MySQLdb,看看是否出现相同的错误,在这种情况下,模块没有成功安装。尝试“定位mysqldb”并给我们输出。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6331377

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档