mysql_config not found

原创 2015年11月21日 13:43:44

在macbook环境下,安装python-mysql时会遇到一个错误:

192:~ Rico$ sudo pip install MySQL-python

Downloading/unpacking MySQL-python

  Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded

  Running setup.py (path:/private/tmp/pip_build_root/MySQL-python/setup.py) egg_info for package MySQL-python

    sh: mysql_config: command not found

    Traceback (most recent call last):

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

      File "/private/tmp/pip_build_root/MySQL-python/setup.py", line 17, 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 17, in <module>


  File "/private/tmp/pip_build_root/MySQL-python/setup.py", line 17, 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


遇到上述错误,首先检查两点:

1.有没有安装mysql

    如果没有安装mysql,请先安装mysql。

2.mysql的环境变量配置

    如果安装了mysql,讲mysql的bin目录添加到PATH环境变量中,且将mysql lib目录路径添加到DYLD_LIBRARY_PATH变量中。

    export MYSQL_HOME="实际环境中的mysql跟目录"

    export PATH=$MYSQL_HOME/bin:$PATH

    export DYLD_LIBRARY_PATH=$MYSQL_HOME/lib:$DYLD_LIBRARY_PATH

经过以上1和2步的操作,应该没问题了,就可以进行安装

    sudo pip install MySQL-python


mac os 上安装mysqldb,EnvironmentError: mysql_config not found

要在mac os上安装 mysqldb 首先,下载MySQLdb:http://sourceforge.net/projects/mysql-python/ 下载MySQL-pytho...
  • Waleking
  • Waleking
  • 2012年04月21日 01:32
  • 17973

安装MySQL-Python出错mysql_config not found

博客链接 https://uublog.com/article/20170218/issue-mysql-python-mysql-config-not-found/ 用python需要用到mysq...

configure: error: xml2-config not found. Please check your libxml2 installation.

configure: error: xml2-config not found. Please check your libxml2 installation. sudo apt-get ins...

Spring config location file not found exception

1 down vote favorite 1 In my web app i'm trying to use spring security. I have the f...

linux configure: error: xml2-config not found. Please check your libxml2 installation

xml2-config not found. Please check your libxml2 installation

mysql启动错误之eror: Found option without preceding group in config file: /Users/gukey/.my.cnf at line: 1

Mac Os下启动mysql5.6时,出现如下错误: eror: Found option without preceding group in config file: /Users/gukey/...

Mac下Mysql导出sql语句的方法及可能遇到的mysqldump: command not found

原来曾经写过一篇《在windows平台下Mysql将数据库导成SQL语句方法》的文章, 最近切换到了Mac os的开发平台,于是乎自己又琢磨了一套方法 度娘了一下,尚无针对Mac的SQL语句导...

Hive学习2_错误: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH

在启动Hive时,报错: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPAT...

MySQL server PID file could not be found! 问题解决

今天重启mysql的时候出现了一个蛋疼的错误,花了很长时间找遍百度和谷歌,试遍各种解决方法,没用,一点改变都没有 既不是磁盘满了,也不是.....等等等,反正都不是 最最蛋疼的是没有日志!!!满脸...

解决安装MySQL-python出现的:Python version 2.7 required, which was not found in the registry

安装MySQL-python-1.2.3.win-amd64-py2.7.exe,时提示:Python version 2.7 required, which was not found in the...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:mysql_config not found
举报原因:
原因补充:

(最多只允许输入30个字)