[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-03 UTC。"],[[["\u003cp\u003ePython 2.7 will no longer receive updates, bug fixes, or security patches from the Python community after January 1, 2020, so ensuring Deployment Manager templates are compatible with Python 3 is advised.\u003c/p\u003e\n"],["\u003cp\u003eDeployment Manager templates generally do not require code changes to be compatible with Python 3, unless template modules or helper scripts are used.\u003c/p\u003e\n"],["\u003cp\u003eTesting templates for Python 3 compatibility can be done by attempting a test deployment, which, if successful without warnings, indicates compatibility.\u003c/p\u003e\n"],["\u003cp\u003eTemplates incompatible with Python 3 will continue to function until June 2020, but may produce warnings indicating incompatibility or different results compared to Python 2.\u003c/p\u003e\n"],["\u003cp\u003eThe Python.org porting guide can help users with migration of incompatible features to Python 3 if needed.\u003c/p\u003e\n"]]],[],null,["# Migrate your templates to Python 3\n\n[Starting on January 1, 2020](https://www.python.org/doc/sunset-python-2/),\nthe Python community will no longer update,\nfix bugs, or patch security issues for Python 2.7. We recommend that you make\nsure that your Deployment Manager templates are compatible with Python 3 as\nsoon as possible.\n\nFor an overview of the products affected by this change, including information\nabout using the Google Cloud Python client libraries, see\n[Python support on Google Cloud](/python/docs/python2-sunset).\n\nMigrating your Deployment Manager templates\n-------------------------------------------\n\nThe syntax for Deployment Manager does not use any features specific to\nPython 3. In most cases, your templates should work with Python 3 without\nrequiring code changes.\n\nIf you use [template modules](/deployment-manager/docs/configuration/templates/create-template-modules)\nsuch as helper scripts, you must make sure that the scripts are compatible with\nPython 3.\n\nFor information on porting Python 2 code to Python 3, see the\n[Python.org porting guide](https://docs.python.org/3/howto/pyporting.html).\nIf you want to test whether your template is compatible with\nPython 3, try a test deployment with the template. If the deployment succeeds\nwithout any warnings, your template is compatible, and doesn't need changes.\n\nIf your templates have features that are incompatible with Python 3, your\ndeployments will continue to work until June 2020. You might see one of\nthese warnings:\n\n- The template is incompatible with Python 3: The template runs using Python 2,\n but fails with Python 3. The warning shows the Python 3 error message, so that\n you can debug your code.\n\n- The template produced different results with Python 3 and Python 2: This\n could be because your deployment is non-deterministic (for example, it relies\n on the current time or random numbers), or a template might be using a feature\n incompatible with Python 3. If your template is non-deterministic by design,\n you don't need to change it.\n\n If your template uses a feature that is incompatible with Python 3,\n use the guidelines in the\n [Python 3 porting guide](https://docs.python.org/3/howto/pyporting.html)\n to update the template."]]