python安装MySQLdb模块-(ubuntu,windows)

时间:2021-10-01 18:43:55

python没有自带mysql的模块,需要自己安装

ubuntu:

sudo apt-get安装:直接运行

sudo apt-get install python-mysqldb

Windows:

上某全家桶网站,下载MySQL-python的exe文件手动安装

PS:两种系统上,pip安装都会报错(搞不懂):

pip install mysql-python

“Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-u5oLrC/mysql-python”