[Edu-sig] re: novice error ImportError

Lloyd Hugh Allen lha2@columbia.edu
Fri, 20 Sep 2002 06:21:34 -0400


> >>> import leo
> Traceback (most recent call last):
>   File "<pyshell#0>", line 1, in ?
>     import leo
> ImportError: No module named leo

If the module is opened and executed via f5 from IDLE, the path of its
directory is added to the syspath. So (to take from an unquoted part of
the message), if I run my helloworld.py the first time using this
method, then later I'll be able to import (using >>> import foo)
anything else that I wrote and kept in this directory.

Yeah, doesn't help with leo. 'Course, Numeric, pygame, and others, have
nice installers that add themselves to the os.path (at least, they run,
and I didn't touch my os.path).