Python 2 停用状态Python 2 sunset status 已于 2020 年 1 月 1 日正式将 Python 2 转入 EoL(生命周期结束)状态 officially moved Python 2 into EoL (end-of-life) status on January 1, 2020.

这是什么意思呢?What does this mean for you?

Databricks Runtime 6.0 及更高版本Databricks Runtime 6.0 and above

Databricks Runtime 6.0 及更高版本仅支持 Python 3。Databricks Runtime 6.0 and above support only Python 3. 不能使用这些运行时通过 Python 2 创建群集。You cannot create a cluster with Python 2 using these runtimes. 使用这些运行时创建的任何群集都使用 Python 3。Any clusters created with these runtimes use Python 3 by definition.

Databricks Runtime 5.5 LTSDatabricks Runtime 5.5 LTS

使用工作区 UI 创建 Databricks Runtime 5.5 LTS 群集时,默认值为 Python 3。When you create a Databricks Runtime 5.5 LTS cluster by using the workspace UI, the default is Python 3. 你可以选择指定 Python 2。You have the option to specify Python 2. 如果使用 Databricks REST API 创建使用 Databricks Runtime 5.5 LTS 的群集,默认值为 Python 2。If you use the Databricks REST API to create a cluster using Databricks Runtime 5.5 LTS, the default is Python 2. 如果有运行 Python 2 的 Databricks Runtime 5.5 LTS 群集,则无需升级到 Python 3。If you have a Databricks Runtime 5.5 LTS cluster running Python 2, you are not required to upgrade to Python 3.

使用 Databricks REST API 创建群集时,可以使用以下调用来指定 Python 3。You can use the following call to specify Python 3 when you create a cluster using the Databricks REST API.

"spark_env_vars": {
  "PYSPARK_PYTHON": "/databricks/python3/bin/python3"

是否应该升级到 Python 3?Should I upgrade to Python 3?

是否升级取决于你的具体情况,包括对其他系统的依赖关系和依赖项。The decision to upgrade depends on your specific circumstances, including reliance on other systems and dependencies. 应与工程组织一起决定是否升级。This is a decision that should be made in conjunction with your engineering organization.

官方 语句如下所示:The official statement is as follows:

从 2020 年 1 月 1 日起,不会对 Python 2 进行任何新的 bug 报告、修复或更改,且不再支持 Python 2。我们尚未发布 Python 2.7.17(2019 年 10 月 19 日)的发布之日到 1 月 1 日期间所做的一些更改。我们将捆绑这些修补程序(仅这些修补程序)并发布一个 2.7.18,作为一项社区服务。我们计划在 2020 年 4 月发布,因为这对发布经理来说很方便,但它与支持何时结束无关。As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2, and Python 2 is no longer supported. We have not yet released the few changes made between when we released Python 2.7.17 (on October 19th, 2019) and January 1st. As a service to the community, we will bundle those fixes (and only those fixes) and release a 2.7.18. We plan on doing that in April 2020, because that’s convenient for the release managers, not because it implies anything about when support ends.


Azure Databricks 不为已停用的第三方软件提供官方支持。Azure Databricks does not offer official support for discontinued third-party software.

与 Python 2 相关的支持请求无法获得工程支持。Support requests related to Python 2 are not eligible for engineering support.