Ubuntu 16.04 pip 安装 mysql-python 遇见 mysql_config not found

因为在 Ubuntu 需要使用 Python 的连接库 MySQL-Python

$ pip install mysql-python

遇见

...
        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-3JrXSl/mysql-python/

安装 Ubuntu 源里面的一个包 libmysqlclient-dev 即可

$ sudo apt-get update
$ sudo apt-get install libmysqlclient-dev

再次安装 mysql-python 即可。

你可能感兴趣的:(Ubuntu 16.04 pip 安装 mysql-python 遇见 mysql_config not found)