Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Notification when starting debugging and no interpreter has been selected #2494
If you start debugging and no environment is selected, you just get an error with no explanation.
I suggest if no Python environment is selected, we pop up a notification:
I don't know if this is related exactly to what you're describing above, but today I started up a new folder / project for Python for my class and it wasn't debugging like the previous two folders / projects I had been working in.
I ended up comparing some things between the two and noticed that one had this setup in the Workspace Settings file:
Whereas the other one did not.
Once I ended up adding that snippet in to the new folder I was able to debug successfully again but am not sure what I may have done to result in the change (I don't use Python a whole lot and haven't been using Visual Studio Code a whole lot either...I'm basically just looking for a quick/seamless way of running my simple Python code needed for class).
This is basically the error I was receiving initially before making the change above:
@orware yes that's related! Instead of printing an error to the console we should pop up a notification with guidance on how to fix it.
Debugging won't work if you haven't selected a Python interpreter. To set the interpreter you don't actually need to edit settings.json, you can click on the yellow warning icon in the status bar and select Anaconda:
Can you let me know if you see that warning icon and if debugging works after you click on it + select the desired interpreter? If not, we'll have to investigate further.
As to why you have to keep modifying the setting for new projects, the Workspace Settings file only apply to the current folder you're working on, so you need to add that to every workspace you work in. To make it apply to all workspaces, you can edit your User settings file instead.
@qubitron so I was about to respond and say I didn't see that in the status bar (but I was looking over on the far right, rather than the far left and then noticed it there).
After clicking on it and selecting the Anaconda environment it was able to Run with or w/o debugging just fine so I think that solves the issue for me ;-).
I did get the prompt regarding installing the new user version of VS Code a few weeks ago but decided against installing it for the time being, but I'll check to see if I can adjust that User Settings file you mentioned to make things perhaps a little easier for me down the road, but clicking on that icon once per folder is not too bad (now that I know where it is ;-).