pythonvisual-studio-codepythoninterpreter

How do you get Visual Studio Code to use different Python interpreter?


I'm new to VS Code/Python, and I'm trying to get VSCode to run a specific version of Python (seems I have multiple versions installed).

I tried the following code:

import sys
print(sys.version)

When I run the file, some reason, it shows:

  3.5.2 |Anaconda 4.2.0 (32-bit)| (default, Jul  5 2016, 11:45:57) [MSC v.1900 32 bit (Intel)]

I've tried the following: At the very bottom of VSCode, I clicked on the Python version, then clicked on "Python 3.7.3 64-bit", but when I reran the code, it still shows "3.5.2 |Anaconda..."

I also tried checking the settings, and it's showing:

  Python: Python Path
    C:\Users\[MY_USE_NAME]\AppData\Local\Programs\Python\Python37-32\python.exe

I also tried just typing "python" in the command like, and it still says "Python 3.5.2".

Any idea what I'm doing wrong? I'm very new to VS Code, so hopefully it's something simple.

screenshot


Solution

  • Open command pallete with F1 (on Windows) and type Python: Select Interpreter.