CentOS下用pip安装mysql_python报错EnvironmentError: mysql_config not found 如何解决

栏目: 编程语言 · Python · 数据库 · Mysql · 发布时间: 7年前

内容简介:CentOS下用pip安装mysql_python报错EnvironmentError: mysql_config not found 如何解决

CentOS下用pip安装mysql_python报错EnvironmentError: mysql_config not found 如何解决?

报错提示如下:

Running setup.py egg_info for package mysql-python  

    sh: mysql_config: command not found  

    Traceback (most recent call last):  

      File "<string>", line 16, in <module>  

      File "/tmp/pip-build/mysql-python/setup.py", line 18, in <module>  

        metadata, options = get_config()  

      File "setup_posix.py", line 43, in get_config  

        libs = mysql_config("libs_r")  

      File "setup_posix.py", line 25, in mysql_config  

        raise EnvironmentError("%s not found" % (mysql_config.path,))  

    EnvironmentError: mysql_config not found  

    Complete output from command python setup.py egg_info:  

    sh: mysql_config: command not found  

  

Traceback (most recent call last):  

  

  File "<string>", line 16, in <module>  

  

  File "/tmp/pip-build/mysql-python/setup.py", line 18, in <module>  

  

    metadata, options = get_config()  

  

  File "setup_posix.py", line 43, in get_config  

  

    libs = mysql_config("libs_r")  

  

  File "setup_posix.py", line 25, in mysql_config  

  

    raise EnvironmentError("%s not found" % (mysql_config.path,))  

  

EnvironmentError: mysql_config not found  

  

----------------------------------------  

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/mysql-python  

Storing complete log in /root/.pip/pip.log  

解决方法

安装mysql-devel后正常运行

yum install mysql-devel

如果手工安装mysql_python

在setup_posix.py内找到mysql_config.path

变成mysql_config.path=/xxx/xxx(mysql安装路径/bin/mysql_config)



以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Hacking Growth

Hacking Growth

Sean Ellis、Morgan Brown / Crown Business / 2017-4-25 / USD 29.00

The definitive playbook by the pioneers of Growth Hacking, one of the hottest business methodologies in Silicon Valley and beyond. It seems hard to believe today, but there was a time when Airbnb w......一起来看看 《Hacking Growth》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码