Help ! I can't set up my code runner to work on vscode

please am using the new version of vscode and I can’t set the code runner to work with the vscode the video demonstration is not the same with what am seeing am really frustrated from this have been trying for days

You will need to be more specific to get help. What error are you seeing? What OS are you using? VSCode has a canonical tutorial for running python:

I am running on Mac OS

I am running on Mac OS and am trying to integrate the code runner .runner to run on the output after print even the output is not showing anything

Have you installed python using homebrew (as per the tutorial)?

In the terminal, what do you get when you run this command:

python3 --version

That should print out the version of Python you are using if Python is correctly installed.

If Python is correctly installed, you should be able to tell VSCode to use the correct Python interpreter: Get Started Tutorial for Python in Visual Studio Code.

Once all of that is done, you should be able to use the play button to run your code in VSCode.

have done everything on this link and this output here I am not getting anything there

That looks like you triggered the debugger. Also, it looks like you had a line 5 at one point with just “pr” on it.

yes that is true I have an extra line with just PR but am worried why the output terminal is not showing anything at all

That might be something to do with triggering the debugger rather than just running the code. I am not sure if running the debugger still triggers output normally.

1 Like

so what can I do ? am just worried cos am a newbie here

No worries, everyone is a newbie at some point.

Check the tutorial again and you will see there are two different ways to “run” the program. One is just running the program, but the other is using the debugger. We want to do the first one which just runs the file rather than using the debugger.

1 Like

it is very simple:
In code runner page you can see you can add this to settings.json

{
    "code-runner.executorMap": {
        "javascript": "node",
        "php": "C:\\php\\php.exe",
        "python": "python",
        "perl": "perl",
        "ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
        "go": "go run",
        "html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
        "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
        "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
    }
}

I just added
this in the settings json

    "code-runner.executorMap": {
        "python": "python3",
    }

to get there click on settings wheel on the code runner page and search for

Code-runner: Language ID To File Extension Map
Set the mapping of languageId to file extension.
Edit in settings.json

It will open the json and you there add this piece of json
IT WORKS!

can you please do a short video for me or can you remote on pc and set this for me it seems I have scattered everything

  1. Search code runner and scroll into instructions.
    In these instructions the author is talking about a piece of json that is actually missing in the settings json so you have to put it there.

this forum is not letting me add all the picts at once…
so have to do a collage
1, 2, 3 4 steps.
Got it?

wowowow Thank you so much it work now am very grateful bro

1 Like