title: EnvironmentError: mysql_config not found
body: <p><strong>EnvironmentError: mysql_config not found, while installing MySQL-python</strong></p>
  
  <p>Could someone advice me on what to do? I did the following from my-side: </p>
  
  <p>Error I got while installing with pip:</p>
  
  <pre><code>  ubuntu12.04@ubuntu12.04:~$ sudo pip install MySQL-python
      Downloading/unpacking MySQL-python
      Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
      Running setup.py egg_info for package MySQL-python
      sh: 1: mysql_config: not found
   Traceback (most recent call last):
    File "&lt;string&gt;", line 16, in &lt;module&gt;
    File "/tmp/pip_build_root/MySQL-python/setup.py", line 18, in &lt;module&gt;
      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
  Complete output from command python setup.py egg_info:
  sh: 1: mysql_config: not found
  
  Traceback (most recent call last):
  
   File "&lt;string&gt;", line 16, in &lt;module&gt;
  
   File "/tmp/pip_build_root/MySQL-python/setup.py", line 18, in &lt;module&gt;
  
  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
  
     ----------------------------------------
   Cleaning up...
  Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_roo
  </code></pre>
  
  <p>I am running <strong>UBUNTU 12.04 LTS</strong> on my comp.</p>
  
  <p>Installing manually gives the same error. I tried easy_install, it didn't help either.</p>
  
  <p>I searched for <strong>mysql_config</strong> manually, i couldn't find it any where in by system files.</p>
  
  <p>After a quick search i have found out that <strong>mysql_config</strong> belongs to <strong>libmysqlclient-dev</strong>. So, i tried getting these packages using:</p>
  
  <pre><code> sudo apt-get install libmysqlclient-dev
  </code></pre>
  
  <p>It gave the following output:</p>
  
  <pre><code>  Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package libmysqlclient-dev is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    mysql-server-5.5
  
    E: Package 'libmysqlclient-dev' has no installation candidate
  </code></pre>
  
  <p>I even downloaded libmysqlclient-dev packages from the source and tried installing them manually, it's giving dependency errors. Following is the output while installing.</p>
  
  <pre><code>  ubuntu@ubuntu:~/Downloads$ sudo dpkg -i libmysqlclient-dev_5.5.32-            0ubuntu0.12.04.1_amd64.deb 
    Selecting previously unselected package libmysqlclient-dev.
    (Reading database ... 203659 files and directories currently installed.)
     Unpacking libmysqlclient-dev (from libmysqlclient-dev_5.5.32-0ubuntu0.12.04.1_amd64.deb) ...
    dpkg: dependency problems prevent configuration of libmysqlclient-dev:
    libmysqlclient-dev depends on libmysqlclient18 (= 5.5.32-0ubuntu0.12.04.1); however:
    Version of libmysqlclient18 on system is 5.5.33+dfsg-1.
    dpkg: error processing libmysqlclient-dev (--install):
    dependency problems - leaving unconfigured
    Processing triggers for man-db ...
    Errors were encountered while processing:
    libmysqlclient-dev
  </code></pre>