import error

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Mar 17 05:59:55 EDT 2007


En Fri, 16 Mar 2007 23:49:43 -0300, Nick Burns <theodoremouse at hotmail.com>  
escribió:

> Quick question. I am running python on windows xp. i want to import my  
> own
> module "mymod". However, when I try to import it i get the error message  
> "ImportError:
> no module named mymod".
>
> "mymod" is located in a directory that is part of the computer's "path"  
> env
> variable. Imports fine if 'mymod' is in the current working directory,  
> but not
> otherwise. i had thought that by saving 'mymod'within my normal path  
> that it
> would import successfully, but this is not the case.

Python does not use the system PATH environment variable. Doing this:

import sys
print sys.path

you will see the list of directories that Python would try. Try saving  
your module inside site-packages.

-- 
Gabriel Genellina




More information about the Python-list mailing list