欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

Ubuntu18安装mysqlclient报错,解决方案

时间:2023-05-26
报错原因及展示

        pip3 install mysqlclient   遇到了如下错误

ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gaecn_vj/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gaecn_vj/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-gaecn_vj/mysqlclient/pip-egg-info cwd: /tmp/pip-install-gaecn_vj/mysqlclient/ Complete output (15 lines): /bin/sh: 1: mysql_config: not found /bin/sh: 1: mariadb_config: not found /bin/sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-gaecn_vj/mysqlclient/setup.py", line 15, in metadata, options = get_config() File "/tmp/pip-install-gaecn_vj/mysqlclient/setup_posix.py", line 70, in get_config libs = mysql_config("libs") File "/tmp/pip-install-gaecn_vj/mysqlclient/setup_posix.py", line 31, in mysql_config raise OSError("{} not found".format(_mysql_config_path)) OSError: mysql_config not found mysql_config --version mariadb_config --version mysql_config --libs ----------------------------------------ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决方案

        sudo apt install mysql-client

        sudo apt install libmysqlclient-dev python3-dev

 

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。