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

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

问题描述

我正在使用 Python 2.5.4 版并安装 MySQL 5.0 版和 Django.Django 使用 Python 运行良好,但不适用于 MySQL.我在 Windows Vista 中使用它.

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(混合操作系统)
  2. pip install mysql-python(混合操作系统/python 2)
  3. pip install mysqlclient(混合操作系统/python 3)
  4. apt-get install python-mysqldb(Linux Ubuntu,...)
  5. cd/usr/ports/databases/py-MySQLdb &&make install clean (FreeBSD)
  6. yum install MySQL-python(Linux Fedora、CentOS ...)
  1. easy_install mysql-python (mix os)
  2. pip install mysql-python (mix os/ python 2)
  3. pip install mysqlclient (mix os/ python 3)
  4. apt-get install python-mysqldb (Linux Ubuntu, ...)
  5. cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
  6. yum install MySQL-python (Linux Fedora, CentOS ...)

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

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

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

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