[Tutor] No module named 'module name' -- sub-folders?

spir denis.spir at free.fr
Sun Jan 25 22:21:00 CET 2009

Le Sun, 25 Jan 2009 18:04:00 -0000,
"Alan Gauld" <alan.gauld at btinternet.com> a écrit :

> Nope, PYTHONPATH applies to any OS.
> You need to use it if you have any modules in folders other than
> the default locations used by Python. I think the preferred place
> to set PYTHONPATH is in your .login script but if I'm wrong I'm
> sure a more regular *nix user will say so :-)
> HTH,

I take the opportunity to ask a question about module lookup. I was *sure* that, when searching for a module, python automatically explores sub-folders (both of the current folder and of the pathes listed in PYTHONPATH). But this does not work by me (anymore):
from ospyp.py, located in /home/spir/prog/ospyp, I cannot simply import wikilang which is in /home/spir/prog/ospyp/samples



la vida e estranya

More information about the Tutor mailing list