[mod_python] Cannot Import name errors

Graham Dumpleton grahamd at dscpl.com.au
Wed Sep 7 07:12:08 EDT 2005


Huzaifa Tapal wrote ..
> Hello All,
> 
> I have a very odd problem with a mod_python application I am running. 
> Sporadically, I will get an error in my application that states:
> 
> Import Error:  cannot import name AES
> 
> The module has a "from Crypto.Cipher import AES" line.  Not sure what 
> could be causing this to happen.  I checked error logs but nothing I can
> see that would cause this to happen.  Is the python interpreter 
> corrupted or something for this to happen?  I even manually load a 
> python interpretor and run the import command multiple times but can't
> replicate it.
> 
> Any ideas?

It may be related to a known bug in mod_python. See:

  http://www.dscpl.com.au/articles/modpython-003.html#packages-loaded-wrongly

This is fixed in mod_python 3.2.

Suggest you try mod_python 3.2 beta.

Can someone here post how to get 3.2 beta from subversion of last beta snapshot
tarball. I don't have all my links handy to cut and paste.

Issue can't really be purused until you can ascertain that it is still a problem with 3.2.
Would at least need to know whether you mix use of apache.import_module() and
"import" statement for the same Python module/package which has been the source
of this particular issue in the past.


Graham


More information about the Mod_python mailing list