PYTHONPATH breaks MySQLdb

Aljosa Mohorovic aljosa.mohorovic at gmail.com
Fri Apr 25 08:56:12 EDT 2008


i have a working MySQLdb module (/usr/lib/python2.4/site-packages/
MySQL_python-1.2.2-py2.4-linux-i686.egg), using it without problems.

"clean shell" after login:
python -c "import MySQLdb" reports no errors

if i export PYTHONPATH:
export PYTHONPATH=/var/www/projects/uv_portal/portal

python -c "import MySQLdb" reports no errors as in previous case

if i export PYTHONPATH:
export PYTHONPATH=/var/www/projects/uv_portal/portal/apps

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

is there any reason why this happens?

Aljosa Mohorovic



More information about the Python-list mailing list