This is the structure of my project:
project (folder)
main.py
assets (folder)
a.py
b.py
When I import module a into module b and run main.py, I get No module named 'a'.
Yet if I run b.py directly, it imports a.py just fine.
a and b are in the same directory, so what am I missing? FWIW, I am using Python 3.10.
main.py:
import assets.b as bb
a.py:
def func(x):
print(x)
b.py:
import a
a.func('hello')