Ok, so I'm trying to use MySQLdb together with PyApache, an apache mod that allows apache to invoke python scripts directly. With PyApache turned off, everything is great, my CGIs execute normally.
With PyApache turned on, my scripts execute normally the first time, but on subsequent times fail with the exception:
ImportError: No module named MySQLdb
I thought maybe there's a problem with the module path being corrupted, but I've verified that other modules placed in site-packages continue to function. Perhaps because those other modules were simple pure python modules and MySQLdb involves a dynamic library.
My guess is that since PyApache keeps the same python interpreter in memory and reuses it to execute CGIs, somehow the the MySQLdb module isn't being cleaned up properly after the first load, preventing later imports from working.
I realize this might well be a PyApache bug, but I wanted to know if this makes sense to anyone here.
Thanks,
Jermey
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, so I'm trying to use MySQLdb together with PyApache, an apache mod that allows apache to invoke python scripts directly. With PyApache turned off, everything is great, my CGIs execute normally.
With PyApache turned on, my scripts execute normally the first time, but on subsequent times fail with the exception:
ImportError: No module named MySQLdb
I thought maybe there's a problem with the module path being corrupted, but I've verified that other modules placed in site-packages continue to function. Perhaps because those other modules were simple pure python modules and MySQLdb involves a dynamic library.
My guess is that since PyApache keeps the same python interpreter in memory and reuses it to execute CGIs, somehow the the MySQLdb module isn't being cleaned up properly after the first load, preventing later imports from working.
I realize this might well be a PyApache bug, but I wanted to know if this makes sense to anyone here.
Thanks,
Jermey
I'm using PyApache+MySQLdb and can duplicate. It seems very likely to be related to this problem:
http://sourceforge.net/forum/forum.php?thread_id=148376&forum_id=70461
I've followed up there.