解决问题:OSError: mysql_config not found

通过pip install mysqlclient时报出了OSError: mysql_config not found错误,如下

Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-o4j1ozxx/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/tmp/pip-build-o4j1ozxx/mysqlclient/setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "/tmp/pip-build-o4j1ozxx/mysqlclient/setup_posix.py", line 26, 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-o4j1ozxx/mysqlclient/
You are using pip version 9.0.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

  解决办法

yum install mysql-devel gcc gcc-devel python-devel

 

上一篇:处理 read_csv 报错 OSError:Initializing from file failed


下一篇:OSError: [Errno 22] Invalid argument: 'D:\test\x07'