【问题标题】:What are the supported versions of Python for Visual Studio Code?Visual Studio Code 支持哪些 Python 版本?
【发布时间】:2018-05-05 00:28:28
【问题描述】:

或者哪里有 Visual Studio Code 支持的 Python 版本的已发布列表?

此外,如果您的机器的操作系统有所不同,这也将有助于了解。

【问题讨论】:

    标签: python macos visual-studio-code python-2.4


    【解决方案1】:

    根据their documentation,如果您链​​接到"a supported Python",则要求是“您要使用的Python 版本”。它们明确包括:

    • Linux 上的内置 Python 安装。
    • 在 macOS 上使用 brew install python3 通过 Homebrew 进行安装(不支持在 macOS 上系统安装 Python)。
    • 从 python.org 下载。
    • 从 Anaconda 下载(用于数据科学目的)。

    当然,python.org 的版本一直追溯到 0.9.1,尽管我怀疑任何比 2.0.1 in the main downloads 更早的版本都不算数。

    更现实地说,他们可能只使用当前的 Python 版本进行测试,目前这意味着 2.7、3.5、3.6 甚至 3.7 的预发布版本。如果你想使用 2.5 或 3.3,你可能会得到基于 2.7 或 3.5 语法的语法高亮和错误飞行检查等。但实际运行你的代码应该仍然可以工作。

    另外,如果您使用的是 Mac 并考虑 Homebrew,请注意 brew install python3 会给您一个错误; the package is just called python now, and you install python for 3.x and python@2 for 2.x.

    【讨论】:

      【解决方案2】:

      Microsoft 的 VS Code 的 Python 扩展实际上允许您从检测到或手动设置的环境列表中选择一个解释器(CMD-Shift-P/Ctrl-Shift-P -> Python:选择解释器),因此它应该适用于最新的任何解释器的版本,只要操作系统支持(请记住 VS Code 及其扩展托管在 Electron 中)。 Source

      【讨论】:

        猜你喜欢
        • 2017-03-26
        • 1970-01-01
        • 2018-12-25
        • 1970-01-01
        • 2017-10-11
        • 2014-04-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多