Recently I started using GitHub codespace for the first time. I created a new codespace from one of my repositories. Assuming the folder structure as below:
my-codespace
|--- utils
|------ my_script.py
|--- config.py
I get the following error when I import config.py
inside my_script.py
:
ModuleNotFoundError: No module named 'config'
Autocomplete is working inside the editor, and it recognizes config.py
while I try to import it
After a while red line appears indicating an error
All methods, classes, and variables belonging to config.py
are available inside my_script.py
by autocomplete.
Currently, I'm using PyCharm on my computer and have no issues with that repository but I get the same error when I run it on local VS Code.
I would appreciate it if someone could help me in this regard.