I have this package structure
project/
package_a/
__init__.py
subpackage_b/
__init__.py
module_one.py
subpackage_c
__init__.py
module_two.py
package_b/
module_one.py
def test_func():
return 0
How can I import test_func from module_two.py? I have tried using
from subpackage_b.module_one import test_func
from package_a.subpackage_b.module_one import test_func
from module_one import test_func
but none of them works, giving me ModuleNotFoundError. I understand there are many similar questions here but none of them seems to work for me. One which I have not tried is setting the PYTHONPATH variable, but I am not sure what to set it to. I am using VSCode and the current python.pythonPath is just the python file in my venv folder.
ImportError: attempted relative import with no known parent package