阿里云ECS pip 安装mysqldb-mysql_config not found

  1. pip 安装报错
#pip install MySQL-python
Collecting MySQL-python
  Downloading http://mirrors.aliyun.com/pypi/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
    100% |████████████████████████████████| 112kB 24.1MB/s
    Complete output from command python setup.py egg_info:
    sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-build-z0025N/MySQL-python/setup.py", line 17, in 
        metadata, options = get_config()
      File "/tmp/pip-build-z0025N/MySQL-python/setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "/tmp/pip-build-z0025N/MySQL-python/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-z0025N/MySQL-python/
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
  1. 失败原因,确实libmysqlclient-dev
#apt-get install libmysqlclient-dev
  1. 重新安装,ok
#pip install MySQL-python

你可能感兴趣的:(阿里云ECS pip 安装mysqldb-mysql_config not found)