Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-fs0wmmw4/mysqlclient/

When I type the following command in Ubuntu 16.04

$ pip install mysqlclient

I get the following error:

`enter code here`Collecting mysqlclient
  Downloading https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz (89kB)
    100% |████████████████████████████████| 92kB 136kB/s 
    Complete output from command python setup.py egg_info:
    /bin/sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-fs0wmmw4/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-fs0wmmw4/mysqlclient/setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "/tmp/pip-install-fs0wmmw4/mysqlclient/setup_posix.py", line 26, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    OSError: mysql_config not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-fs0wmmw4/mysqlclient/
like image 724
Deba Avatar asked Apr 16 '18 16:04

Deba


1 Answers

Try these instructions:

https://github.com/PyMySQL/mysqlclient-python

Or if you are using python 3. Go with these commands:

sudo apt-get install libmysqlclient-dev

sudo pip3 install mysqlclient

They both worked in my case.

Hope!! this helps

like image 131
Priyanka Jain Avatar answered Oct 12 '22 14:10

Priyanka Jain