MAC安装MySQL-python报错:EnvironmentError: mysql_config not found

使用命令 pip install MySQL-python时报错:python

Collecting MySQL-python
  Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/nx/nzj3snp57xx4y1x012_ptsdr0000gn/T/pip-install-c52UyQ/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

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

报错信息: mysql_config not foundmysql

使用命令find ./ -name mysql_config查找不到mysql_config 文件。sql

在网上搜了下,很凌乱。bash

源博客:http://stackoverflow.com/questions/25459386/mac-os-x-environmenterror-mysql-config-not-foundcode

只是作了一些提示,我这里把我解决的过程总结一下:ip

1.确保安装了python;get

2.确保你安装了mysql ,没有安装的话能够在这里下载安装包安装:https://dev.mysql.com/downloads/connector/python/博客

3.运行命令修改环境变量:export PATH=$PATH:/usr/local/mysql/binstring

4.安装MySQL-python:pip install MySQL-python==1.2.5pip

这种方式解决了个人问题  

相关文章
相关标签/搜索