MySQLdb not in path causes import Error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mysqldb (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
After upgrading to Ubuntu 8.04 my python MySQLdb module was no longer on sys.path. This would cause an Import Error saying that the python-mysqldb module didn't exist.
The version of python-mysqldb that is installed on my machine, with dselect, is: 1.2.2-5ubuntu1.
Basically the problem here is that the path the python-mysqldb installs to is not included in the default Python module path.
I have found a work around to this by just appending the path to the python-mysqldb module before importing MySQLdb on any script that I need to use MySQLdb.
import sys
sys.path.
import MySQLdb
However, I was hoping that there would be a better, more permanent solution to this.
Did you try to install the Ubuntu package of python-mysqldb?
Does the problem exist there as well?
Is there a reason you installed with dselect instead of from the repository?