installing mysql for python within virtual environment

1.4k views Asked by At

I went through other similar questions, but none of the stuffs mentioned there, served my purpose. My OS is ubuntu 11.04, What i did was created a virtual environment first:

virtualenv mysite

once this was done, i installed django

pip install django==1.3

post django installation i tried to install mysql interface for python:

pip install MySQL-python 

this gave me an error:

Downloading/unpacking MySQL-python
  Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded
  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/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

i further tried:

python -c "import MySQLdb"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named MySQLdb

Please help, thanks.

0

There are 0 answers