You need to use one of the following commands. Which one depends on what OS and software you have and use.
- easy_install mysql-python (mix os)
- pip install mysql-python (mix os/ python 2)
- pip install mysqlclient (mix os/ python 3)
- apt-get install python-mysqldb (Linux Ubuntu, ...)
- cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
- yum install MySQL-python (Linux Fedora, CentOS ...)
来源:https://stackoverflow.com/questions/454854/no-module-named-mysqldb

本文提供了在不同操作系统上安装MySQL-Python模块的方法,包括使用easy_install、pip、apt-get、yum等命令进行安装。
836

被折叠的 条评论
为什么被折叠?



