Home > Coding, ubuntu > Error installing mysql-python package

Error installing mysql-python package

If you are trying to do


pip install mysql-python

and you end up with an error which is the following (or similar):

(env)goshawk@earth:~/Projects/bvisible$ pip install mysql-python
Downloading/unpacking mysql-python
  Running setup.py egg_info for package mysql-python
    sh: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/home/goshawk/Projects/bvisible/env/build/mysql-python/setup.py", line 15, 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 24, 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: mysql_config: not found

Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/home/goshawk/Projects/bvisible/env/build/mysql-python/setup.py", line 15, 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 24, 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
Storing complete log in /home/goshawk/.pip/pip.log

The solution to the problem is to install the libmysqlclient-dev package in this way:

sudo apt-get install libmysqlclient-dev

You can now run pip install mysql-python without any further problem.

About these ads
Categories: Coding, ubuntu
  1. Lautaro Linquimán
    22/10/2011 at 18:30 | #1

    Very Good Thanks You.

  2. 27/12/2011 at 11:09 | #2

    Thank you so much for this useful information. I have also taken some help from this site : http://www.mysqlpython.com It has also helped me a lot in the installing process of Mysql-Python package.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 491 other followers

%d bloggers like this: