What are the supported versions of Python for Visual Studio Code?

1.6k views Asked by At

Or where is there a published list of the supported versions of Python for Visual Studio Code?

Also if one's machine's OS makes a difference that would be helpful to know as well.

2

There are 2 answers

1
abarnert On BEST ANSWER

According to their documentation, if you link to what "a supported Python", is, the requirements are "whichever version of Python you want to use". And they explicitly include:

  • The built-in Python installation on Linux.
  • An installation through Homebrew on macOS using brew install python3 (the system install of Python on macOS is not supported).
  • A download from python.org.
  • A download from Anaconda (for data science purposes).

Of course python.org has versions all the way back to 0.9.1, although I suspect anything older than the 2.0.1 in the main downloads doesn't really count.

More realistically, they probably only test with current Python versions, which as of right now means 2.7, 3.5, 3.6, and maybe 3.7 prereleases. If you wanted to use 2.5 or 3.3, you might well get syntax highlighting and error fly-checking based on 2.7 or 3.5 grammar, etc. But actually running your code should still work.

Also, if you're on a Mac and thinking of Homebrew, it's worth noting that brew install python3 will give you an error; the package is just called python now, and you install python for 3.x and python@2 for 2.x.

0
2niru On

Microsoft's Python Extension for VS Code actually let you select an interpreter from a list of detected or manually set environments (CMD-Shift-P/Ctrl-Shift-P -> Python: Select Interpreter), so it should work with latest version of any interpreter, as long as is supported by the OS (remember that VS Code and its extensions are hosted in Electron). Source