I have the following directory:
└── myproject
├── moduleA
│ ├── __init__.py
│ ├── users.py
├── moduleB
│ ├── __init__.py
│ ├── test_in_B.py
├── test.py
I can easily run test.py
whose content is the following:
from moduleA import users
print(users.name)
However, I cannot run test_in_B.py
whose content is the same as the above and get ModuleNotFoundError: No module named 'moduleA'
error.
Contents for replication:
moduleA (__init__.py)
from moduleB import *
moduleB (__init__.py)
from moduleA import *
users
name = 'user1'
Question
How can I run test_in_B.py
keeping the same structure?