"import" not working?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Feb 23 18:38:37 EST 2009


En Mon, 23 Feb 2009 18:10:07 -0200, Lionel <lionel.keene at gmail.com>  
escribió:

> Taking "DataFileTypes.py" module out of the "...\site-packages
> \DataFileTypes" folder and placing it directly into the "site-
> packages" folder seems to have cleared it up. Some problem between
> package and module usage I suppose.

You're right. To import module "foo", the directory containing the  
"foo.py" file must be listed in sys.path.
To import package "foo", the directory containing the "foo" directory must  
be listed in sys.path; the foo directory itself must contain an  
"__init__.py" file.

-- 
Gabriel Genellina




More information about the Python-list mailing list