技术积累
日进一寸

安装mysqlclient的时候报错OSError: mysql_config not found处理

安装mysqlclient的时候报错了,只需要安装libmysql就可以了。

Complete output (12 lines):
/bin/sh: mysql_config: 未找到命令
/bin/sh: mariadb_config: 未找到命令
/bin/sh: mysql_config: 未找到命令
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-todfbram/mysqlclient/setup.py", line 15, in <module>
    metadata, options = get_config()
  File "/tmp/pip-install-todfbram/mysqlclient/setup_posix.py", line 65, in get_config
    libs = mysql_config("libs")
  File "/tmp/pip-install-todfbram/mysqlclient/setup_posix.py", line 31, in mysql_config
    raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found

安装mysql-devel

centos系统使用yum安装 mysql-devel

yum install mysql-devel

ubuntu 系统apt-get 安装libmysqlclient-dev

apt-get update
apt-get upgrade
apt-get install libmysqlclient-dev

debian 系统

apt install -y libmariadbd18
apt install -y libmariadbd-dev

赞(0)
未经允许不得转载:DongVPS » 安装mysqlclient的时候报错OSError: mysql_config not found处理
分享到: 更多 (0)

评论 1

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    123

    imajeason4年前 (2020-12-14)回复