Am 15. September 2026erreichen alle Cloud Composer 1- und Cloud Composer 2-Umgebungen der Version 2.0.x das geplante Ende des Lebenszyklus und können nicht mehr verwendet werden. Wir empfehlen, die Migration zu Cloud Composer 3 zu planen.
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Cloud Composer unterstützt Python 3.
Welche major.minor.patch-Versionen von Python 3 in einem bestimmten Cloud Composer-Image verwendet werden, sehen Sie in der Liste der Cloud Composer-Versionen.
Nachdem eine Umgebung erstellt wurde, können Sie sie nicht mehr auf eine andere Nebenversion von Python umstellen.
Python 2-Unterstützung in Cloud Composer 1
Die Unterstützung für Python 2 wurde in Cloud Composer-Version 1.19.0 eingestellt:
Ab Version 1.19.0 ist es nicht mehr möglich, neue Umgebungen mit Python 2 zu erstellen oder vorhandene Umgebungen mit Python 2 auf 1.19.0 und höhere Cloud Composer-Versionen zu aktualisieren.
Ab Version 1.19.6 können keine Operatoren mehr verwendet werden, die Python 2 aufrufen. Insbesondere können mit PythonVirtualenvOperator keine virtuellen Umgebungen mehr mit Python 2 erstellt werden.
Bestehende Umgebungen mit Python 2 sind von dieser Änderung nicht betroffen. Es ist möglich, solche Umgebungen über die gcloud CLI, die API und Terraform auf Cloud Composer-Version 1.18.12 oder niedriger zu aktualisieren.
Neue Airflow-Operatoren, Sensoren und Hooks werden nur für Python 3 entwickelt, was dazu führen kann, dass die Verbindungsoptionen für Python 2-Umgebungen veraltet sind. Daher empfehlen wir dringend, Ihre DAGs in eine Python 3-Umgebung zu migrieren und alle neuen Umgebungen mit Python 3 zu erstellen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-29 (UTC)."],[[["\u003cp\u003eCloud Composer exclusively supports Python 3, and the specific versions can be found in the Cloud Composer version list.\u003c/p\u003e\n"],["\u003cp\u003eOnce a Cloud Composer environment is set up, its Python minor version cannot be changed.\u003c/p\u003e\n"],["\u003cp\u003eCloud Composer version 1.19.0 deprecated Python 2 support, preventing the creation of new Python 2 environments or the upgrade of existing ones.\u003c/p\u003e\n"],["\u003cp\u003eStarting from version 1.19.6, operators that use Python 2, such as \u003ccode\u003ePythonVirtualenvOperator\u003c/code\u003e, are no longer functional.\u003c/p\u003e\n"],["\u003cp\u003eAlthough existing Python 2 environments are not directly affected, new Airflow components are developed only for Python 3, making migration to Python 3 highly recommended.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nCloud Composer supports Python 3.\n\nTo see the `major.minor.patch` versions of Python 3 used in a\nspecific Cloud Composer image, see\n[Cloud Composer version list](/composer/docs/composer-versions).\n\nAfter an environment is created, you cannot switch an existing\nenvironment to a different minor Python version.\n\nPython 2 support in Cloud Composer 1\n\nSupport for Python 2 was deprecated in Cloud Composer\nversion 1.19.0:\n\n- Starting from version 1.19.0, it is not possible to create new environments\n with Python 2, or upgrade existing environments with Python 2 to 1.19.0\n and later versions of Cloud Composer.\n\n- Starting from version 1.19.6, it is no longer possible to use any operators\n that call Python 2. In particular, `PythonVirtualenvOperator` can no\n longer create virtual environments with Python 2.\n\n- Existing environments with Python 2 are not impacted by this change. It is\n possible to upgrade such environments to Cloud Composer version 1.18.12\n and earlier through gcloud CLI, API, and Terraform.\n\n- New Airflow operators, sensors, and hooks are only developed for\n Python 3, which may cause connectivity options to be outdated for Python 2\n environments. As such, we highly recommend migrating your DAGs to a\n Python 3 environment, and creating all new environments with Python 3.\n\n| **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.\n\nWhat's next\n\n- [Creating environments](/composer/docs/composer-2/create-environments)\n- [Cloud Composer version list](/composer/docs/composer-versions)\n- [Release Notes](/composer/docs/release-notes)"]]