<br />

<br />

<br />

<br />

<br />

<br />

<br />

Managed Airflow supports Python 3.

To see the `major.minor.patch` versions of Python 3 used in a
specific Managed Airflow image, see
[Managed Airflow version list](https://docs.cloud.google.com/composer/docs/composer-versions).

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

## Python 2 support in Managed Airflow (Legacy Gen 1)

Support for Python 2 was deprecated in Managed Airflow
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.

> [!NOTE]
> **Note:** If you want to continue using Python 2, note that samples located in [python-docs-samples](https://github.com/GoogleCloudPlatform/python-docs-samples) are no longer checked for compatibility with Python 2.7.

## What's next

- [Creating environments](https://docs.cloud.google.com/composer/docs/composer-2/create-environments)
- [Managed Airflow version list](https://docs.cloud.google.com/composer/docs/composer-versions)
- [Release Notes](https://docs.cloud.google.com/composer/docs/release-notes)