pip 安装mysqlclient报错OSError: mysql_config not found

Posted zhouxinfei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pip 安装mysqlclient报错OSError: mysql_config not found相关的知识,希望对你有一定的参考价值。

执行 pip install mysqlclient 报错信息如下:

[[email protected] bin]# pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.12.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ctrzre4u/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/tmp/pip-build-ctrzre4u/mysqlclient/setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "/tmp/pip-build-ctrzre4u/mysqlclient/setup_posix.py", line 26, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    OSError: mysql_config not found

 

解决办法:

yum install mysql-devel

pip install mysqlclient

 

以上是关于pip 安装mysqlclient报错OSError: mysql_config not found的主要内容,如果未能解决你的问题,请参考以下文章

pip 安装mysqlclient报错OSError: mysql_config not found

pip install mysqlclient报错(OSError: mysql_config not found)

python pip安装 mysqlclient 报错 raise EnvironmentError("%s not found" % (_mysql_config_path,))

pip install mysqlclient 安装失败

mac下python3.6安装mysqlclient报错mysql_config: command

Mac上安装mysqlclient的报错