[mod_python] Cannot Import name errors

Huzaifa Tapal huzaifa at hostway.com
Wed Sep 7 09:58:01 EDT 2005


The module that the import statement is in is loaded with 
apache.import_module(), however, the AES module in Crypto.Cipher is not 
imported with import_module.

So Module A as the "from Crypto.Cipher import AES" statement and Module 
A was imported from my handler using the import_module() function.

Not sure if this problem is the same as the problem described in the 
"Packages Loaded Wrongly" section.

Hozi

Graham Dumpleton wrote:

>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
>
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050907/1ea45394/attachment.html


More information about the Mod_python mailing list