'Configure the path of the default "run in terminal" option
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
Solution 1:[1]
The fix was adding:
"terminal.integrated.env.windows": {"PYTHONPATH": "${workspaceFolder}"}
to settings.json and restarting VSCode
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | VaderFuntime |
