[Tips]How to switch python3 and python2 in VSCode

I ‘ve been using python2 in VSCode for a long time, but I have to run python3 code this time. How to switch python2 and python3?

GOAL

To switch python2 and python3 in VSCode

Environment

Windows10
python2.7 and python3.8.5
Visual Studio Code1.49.0

Method

Open command palette with the shortcut Ctrl+Shift+P. *If you are working on macOS, use the shortcut Command+Shift+P.

And select “select interpreter”

from VSCode

And choose the python version that you’d like to use.

from VSCode

If you need, please install Linker such as pylint for the new version of python.