Ubuntu 16.04 Python 3.6 pip 安装mysqlclient

安装MySQL时运行下面命令

sudo apt-get install mysql-server
apt-get install mysql-client
sudo apt-get install libmysqlclient-dev

没什么遗漏,pip 安装mysqlclient应该不会报错

如果报错:

_mysql.c:40:20: fatal error: Python.h: No such file or directory
 compilation terminated.
 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

运行:

sudo apt-get install python3.6-dev libmysqlclient-dev


你可能感兴趣的:(python进阶)