I found my problem. I did not update the program key to always point to my main.py. Instead, the current open file was being executed as a Python script — launch.json Changing the program key or navigating to a different file solved the problem. Obvious once you notice it!