Getting python MySQLdb to run on Ubuntu
Question: I created a virtualbox with a fresh install of ubuntu 9.10.

I am trying to get MySQLdb to run on python but I'm failing at the `import
MySQLdb`

I first tried `sudo easy_install MySQL_python-1.2.3c1-py2.6-linux-i686.egg`
and then `sudo apt-get install python-mysqldb`.

Both apparently installed ok, but gave me the following error message when in
python I have the import line:

    
    
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/MySQLdb/__init__.py", line 19, in <module>
    
    File "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/_mysql.py", line 7, in <module>
    File "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/_mysql.py", line 6, in __bootstrap__
    ImportError: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory
    

I have already installed MySQL and it is running, if that matters at all. I
tried following
[this](http://forums.mysql.com/read.php?50,191097,193961#msg-193961), but
failed in step 2


Answer: Your MySQLdb egg installation looks like it is not working properly. You
should go into /usr/local/lib/python2.6/dist-packages and remove it.

The Ubuntu python-mysqldb package should work fine. Unless you have a good
reason, you should stick to your distribution's package manager when
installing new software.

