python import error

John Gordon gordon at panix.com
Tue Dec 10 23:53:34 EST 2013


In <93405ea9-6faf-4a09-9fd9-ed264e3136e1 at googlegroups.com> smilesonisamal at gmail.com writes:

>   File "aaa.py", line 5, in <module>
>     from ccc.ddd import sss
> ImportError: No module named ccc.ddd

> directory structure as follows:

> ccc
> |
>  ddd
>    |
>     aaa.py
>     sss.py

A python file isn't importable unless the directory also contains a file
named __init__.py .

Try making __init__.py files in the ccc and ddd directories.  If you
don't know what to put in them, just leave them blank.

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon at panix.com    watch 'House', or a real serial killer to watch 'Dexter'.




More information about the Python-list mailing list