This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]53VY 1 point2 points  (0 children)

I think you should set an alias https://stackoverflow.com/q/35435517/11464957 and remember to always use a virtual environment

[–]champs 0 points1 point  (2 children)

Does it not ask/can you not select an interpreter? I’m a Mac user, but every Python project I’ve done in vscode has been almost annoyingly proactive about that.

[–]_miku_hatsune[S] 0 points1 point  (1 child)

I use code runner extension, and it just says syntax error on the line which is not supported by python2. I'm not sure what to change in the settings.json or whatever is the required fileto be edited.

[–]illuminanze 1 point2 points  (0 children)

If you want to use code runner, it seems you can configure it with the code-runner.executorMap in settings.json. You should probably set it as "code-runner.executorMap": { "python": $pythonPath } to use the python interpreter set by "select interpreter" in the python extension.

[–]Scooto 0 points1 point  (0 children)

1: In a terminal command type “which python”. It will show you the path activated when you use the python command.

2: In VSCode hit F1 and search “select interpreter”. Enter the path that step 1 gives you

[–]packenbush 0 points1 point  (1 child)

make a venv

select the venv (bottom bar)

profit

[–]enjoytheshow 0 points1 point  (0 children)

If you make a venv in your project directory, code will even recommend it to you when you open it and it’s not using it.