Vscode-code-runner: Can't use python3

Created on 13 Sep 2018  路  7Comments  路  Source: formulahendry/vscode-code-runner

I've followed all recommendations and questions asked around and have downloaded the latest version of vs but when I set python to use python3 instead of 2 it just doesn't work. My config:

{
    "python.jediEnabled": false,
    "python.pythonPath": "/usr/local/bin/python3",
    "workbench.colorTheme": "Solarized Light",
    "code-runner.runInTerminal": true,
    "code-runner.defaultLanguage": "python",
    "code-runner.clearPreviousOutput": true
}

Doing

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

isn't working. Any help please?

question

Most helpful comment

The above suggestion also fixed my issue, would be nice if python 3 was enabled by default, as python 2 will be unsupported soon anyways

All 7 comments

hey there, i think u can try simply add "code-runner.executorMap.python": "python3 -u" to the user settings and it should work.
cheers!

@creeptonik , did you have Shebang for your python file?

hey there, i think u can try simply add "code-runner.executorMap.python": "python3 -u" to the user settings and it should work.
cheers!

It says "Unknown configuration setting"
settings json pythontools 2018-09-21 09-41-05

@formulahendry Shebang? Not sure...

@creeptonik , could you have a screenshot of your output and your python file?

Here you go, it's the same error as if I was running python 2 ('No module named requests'):
ft_get_write_video py pythontools 2018-09-21 11-44-14

Please set code-runner.respectShebang as false

The above suggestion also fixed my issue, would be nice if python 3 was enabled by default, as python 2 will be unsupported soon anyways

Was this page helpful?
0 / 5 - 0 ratings

Related issues

w3adventures picture w3adventures  路  3Comments

seiferthan picture seiferthan  路  4Comments

spacesuitdiver picture spacesuitdiver  路  3Comments

mjaniec2013 picture mjaniec2013  路  5Comments

bhavinkamani picture bhavinkamani  路  4Comments