Weird import problem

Diez B. Roggisch deets at nospam.web.de
Sun May 4 12:38:42 EDT 2008


Anton81 schrieb:
> I have a directory structure like
> 
> NS/dir1/file1.py
> NS/dir2/file2.py


This *must* be wrong or at least not the full directory listing - please 
read

http://docs.python.org/tut/node8.html

> if in the python shell I type
> 
> import NS.dir1.file1
> 
> it works, however typing
> 
> import NS.dir2.file2
> 
> fails with
> 
> ImportError: No module named dir2.file2
> 
> Any ideas what could go wrong?
> Directory permissions seem to be OK.

Missing __init__.py in the dir2?

Diez



More information about the Python-list mailing list