I've recently tried running my Python project in VSCode.
I have in my code imports from other files withing my project. The problem is that when I try running it from the default "play button"/"run in terminal" option, it does not detect my other files. (I opened the entire project's folder, as well as created a workspace with it))
When I created a debug configuration, this line was added automatically:
"env": {"PYTHONPATH": "${workspaceRoot}"}
which enabled the requested import.
I was still not able to figure how to make it work with the default "play button". (e.g see what run configuration it uses, etc)
Thanks for your help! <3
The fix was adding:
to
settings.json
and restarting VSCode