Lets say I have the following folder structure:
project/
a.py
module/
b.py
c.py
__init__.py
a.py
needs to import b.py
, so it should include from module import b
b.py
needs to import c.py
, so it should include simply import c
since they are in the same folder. But this throws a ModuleNotFoundError
when a.py
is run.
If I switch the line in b.py
to be from module import c
then a.py
will run, but if I try to run b.py
on its own it throws ModuleNotFoundError
.
what is the correct way to import in Python?