[Tutor] Project tree

Danny Yoo dyoo at hashcollision.org
Tue Nov 11 03:02:51 CET 2014

> Traceback (most recent call last):
>   File "E:\tests\project_name\start.py", line 1, in <module>
>     from src import moda
>   File "E:\tests\project_name\src\moda.py", line 1, in <module>
>     import modb
> ImportError: No module named 'modb'

Hi Wiktor,

In Python 3, imports are not relative by default.  You might need to
adjust your imports to be explicitly relative.

Concretely, within moda.py, you'll want to change:

    import modb


    from . import modb

See: https://docs.python.org/3/tutorial/modules.html#intra-package-references
for more details.

If you have more questions, please feel free to ask!

More information about the Tutor mailing list