0

I am on MacOS Mojave 10.14.6 (18G103). When I try to install mysql-python it throws an error :

$ pip install --upgrade setuptools
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/site-packages (41.5.1)
$ pip install mysql-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/90/6l6jqf191f74hg282swdz5080000gn/T/pip-install-RetBjz/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

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/90/6l6jqf191f74hg282swdz5080000gn/T/pip-install-RetBjz/mysql-python/
0

You can install mysqlclient or pymysql,I prefer the latter:


pip install pymysql

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .