Python mysqlclient==1.3.12 pip安装时出错
我在Ubuntu18.04VPS上运行Python3.6.8,并尝试安装mysqlclient==1.3.12的Django项目 当我运行Python mysqlclient==1.3.12 pip安装时出错,python,mysql,Python,Mysql,我在Ubuntu18.04VPS上运行Python3.6.8,并尝试安装mysqlclient==1.3.12的Django项目 当我运行pip install-r requirements.txt(在虚拟环境中)时,我得到了这个错误 ERROR: Command errored out with exit status 1: command: /var/www/authenticjobs/env/bin/python3 -c 'import sys, setuptools,
pip install-r requirements.txt(在虚拟环境中)时,我得到了这个错误
ERROR: Command errored out with exit status 1:
command: /var/www/authenticjobs/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uzc9j1dl/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uzc9j1dl/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-uzc9j1dl/mysqlclient/
Complete output (10 lines):
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-uzc9j1dl/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-install-uzc9j1dl/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-install-uzc9j1dl/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我缺少什么?您必须安装mysql客户端工具/库。您安装的是服务器,而不是客户端。也可能是服务器的副本
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-09-11 10:25:22 UTC; 4min 3s ago
Main PID: 9092 (mysqld)
Tasks: 28 (limit: 4915)
CGroup: /system.slice/mysql.service
└─9092 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid