文章目录
  1. 1. 这个说明缺少对应的库,解决办法是:
    1. 1.1. mix os (easy_install)
    2. 1.2. mix os (pip)
    3. 1.3. Ubuntu
    4. 1.4. FreeBSD
    5. 1.5. Fedora, CentOS


如果在python程序执行时遇到这个错误提示“No module named MySQLdb

这个说明缺少对应的库,解决办法是:

mix os (easy_install)

1
easy_install mysql-python (mix os)

mix os (pip)

1
pip install mysql-python (mix os)

Ubuntu

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

FreeBSD

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

Fedora, CentOS

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

对应后面括号内系统执行相应的命令就可以进行安装

文章目录
  1. 1. 这个说明缺少对应的库,解决办法是:
    1. 1.1. mix os (easy_install)
    2. 1.2. mix os (pip)
    3. 1.3. Ubuntu
    4. 1.4. FreeBSD
    5. 1.5. Fedora, CentOS