没有名为MySQLdb的模块 [英] No module named MySQLdb

查看:145
本文介绍了没有名为MySQLdb的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Python 2.5.4版本,并安装MySQL 5.0和Django。 Django在Python中工作正常,但不是MySQL。我在Windows Vista中使用它。

解决方案

您需要使用以下命令之一。哪个取决于您使用的操作系统和软件。


  1. easy_install mysql-python (mix os)

  2. pip install mysql-python (mix os)

  3. apt-get install python-mysqldb < (Linux Ubuntu,...)

  4. cd / usr / ports / databases / py-MySQLdb&& make install clean (FreeBSD)

  5. yum install MySQL-python (Linux Fedora,CentOS ...)

对于Windows,请参阅此答案:安装mysql-python(Windows)


I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista.

解决方案

You need to use one of the following commands. Which one depends on what OS and software you have and use.

  1. easy_install mysql-python (mix os)
  2. pip install mysql-python (mix os)
  3. apt-get install python-mysqldb (Linux Ubuntu, ...)
  4. cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
  5. yum install MySQL-python (Linux Fedora, CentOS ...)

For Windows, see this answer: Install mysql-python (Windows)

这篇关于没有名为MySQLdb的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆