Here's my file structure
test/
-dir1
-thing.py
-dir2
-__init__.py
-thing2.py
I am using python 3.7 and windows 10.
In thing.py
, I'm trying to import a function called foo
from thing2.py
and have it execute when I run thing.py
. My code works perfectly in PyCharm when I press run. However, when I run thing.py
from the terminal directly or through code runner in VSCode, I get the following error:
from dir2.thing2 import foo
ERROR: ModuleNotFoundError: No module named 'dir2
Is the issue something to do with my PYTHONPATH or something else?