Import error depending on where importing from

Jay O'Connor joconnor at
Sat Aug 31 18:15:29 CEST 2002

I'm having problems importing a module based on where I'm at

For certain reasons, I had to put the MySQLdb files in my own directory
(called 'lib').   Now, when I'm in the lib directory I can import MySQLdb
and use it fine.  However, when I'm one directory up, and I try to do
"from lib import MySQLdb" I get 

>>> from lib import MySQLdb
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "", line 19, in ?
ImportError: _mysql: init failed

There is an empty file in lib and is in lib as well

This is on Python 1.5.2

Any idea why the init fails?

Take care,
Jay O'Connor
joconnor at

More information about the Python-list mailing list