Supported Python versions

Cloud Composer supports Python 3.

To see the major.minor.patch versions of Python 3 used in a specific Cloud Composer image, see Cloud Composer version list.

After an environment is created, you cannot switch an existing environment to a different minor Python version.

Python 2 support in Cloud Composer 1

Support for Python 2 was deprecated in Cloud Composer version 1.19.0:

  • Starting from version 1.19.0, it is not possible to create new environments with Python 2, or upgrade existing environments with Python 2 to 1.19.0 and later versions of Cloud Composer.

  • Starting from version 1.19.6, it is no longer possible to use any operators that call Python 2. In particular, PythonVirtualenvOperator can no longer create virtual environments with Python 2.

  • Existing environments with Python 2 are not impacted by this change. It is possible to upgrade such environments to Cloud Composer version 1.18.12 and earlier through gcloud CLI, API, and Terraform.

  • New Airflow operators, sensors, and hooks are only developed for Python 3, which may cause connectivity options to be outdated for Python 2 environments. As such, we highly recommend migrating your DAGs to a Python 3 environment, and creating all new environments with Python 3.

What's next