1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#Ubuntu的话,也是安装一些Mysql的依赖或开发库
apt-get install libmysql-dev
apt-get install libmysqlclient-dev
apt-get install python-dev #python3要装python3-dev
pip install mysqlclient
#此时如果遇到如下错误
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
\----------------------------------------
Command "python setup.py egg_info" failed with error code 1in /tmp/pip-build-p8wpb1kf/mysqlclient/
#需要安装一下setuptools包,直接pip install setuptools==33.1.1,python3的话就pip3,看你的系统。
|