[root@iZ2ze5zdki0r7z2om8cze5Z ~]# pip3 install mysqlclient
Collecting mysqlclient
Downloading http://mirrors.aliyun.com/pypi/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz (90kB)
100% |████████████████████████████████| 92kB 18.7MB/s
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: 未找到命令
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-tv34qz2u/mysqlclient/setup.py", line 18, in <module>
metadata, options = get_config()
File "/tmp/pip-build-tv34qz2u/mysqlclient/setup_posix.py", line 53, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-tv34qz2u/mysqlclient/setup_posix.py", line 28, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tv34qz2u/mysqlclient/
添加软链接
ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
再走一遍
[root@iZ2ze5zdki0r7z2om8cze5Z ~]# pip3 install mysqlclient
Collecting mysqlclient
Downloading http://mirrors.aliyun.com/pypi/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz (90kB)
100% |████████████████████████████████| 92kB 31.7MB/s
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... done
Successfully installed mysqlclient-1.3.13