module name not recognized

Darren Dale dd55 at cornell.edu
Sun Oct 10 14:09:06 EDT 2004


Robert Kern wrote:

> Darren Dale wrote:
> 
>> # trying /home/darren/temp/simCTR/fresnel.so
>> # trying /home/darren/temp/simCTR/fresnelmodule.so
>> # trying /home/darren/temp/simCTR/fresnel.py
>> # trying /home/darren/temp/simCTR/fresnel.pyc
>> Traceback (most recent call last):
>>   File "temp.py", line 7, in ?
>>     from simCTR.fresnel import *
>> ImportError: No module named fresnel
> 
> Don't execute python from /home/darren/temp .
> 

I see. I had two problems. I didnt realize there was an old simCTR directory
in ~/temp. Python was searching this directory, and when it didnt find the
module it raised an error. I read that python would try the current
directory first, and if that failed it would try other places along the
python search path. The caveat is that if python finds a package but not
the module, it will not continue the search. Thank you everyone, especially
Robert and Alan.



More information about the Python-list mailing list