Il supporto di Cloud Deployment Manager terminerà il 31 dicembre 2025. Se al momento utilizzi Deployment Manager, esegui la migrazione a Infrastructure Manager o a una tecnologia di deployment alternativa entro il 31 dicembre 2025 per assicurarti che i tuoi servizi continuino senza interruzioni.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Puoi utilizzare le librerie Python nei tuoi modelli Python. Deployment Manager carica ed esegue il codice Python nei tuoi modelli in un ambiente sicuro.
Puoi utilizzare le librerie supportate da Deployment Manager, elencate di seguito. Per usare una libreria Python diversa, importa il codice sorgente completo della libreria nel modello.
Librerie supportate
Deployment Manager supporta librerie Python specifiche che puoi utilizzare nei modelli. Queste librerie includono:
Se vuoi importare librerie non supportate esplicitamente, importa la libreria utilizzando il nome file. Questa opzione è particolarmente utile se vuoi importare i tuoi metodi di assistenza. Le stesse limitazioni per le chiamate di sistema si applicano anche alle librerie personalizzate.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-03 UTC."],[[["\u003cp\u003ePython libraries can be used within Python templates in Deployment Manager, which runs the code in a secure environment.\u003c/p\u003e\n"],["\u003cp\u003eDeployment Manager supports specific Python libraries, such as \u003ccode\u003ebase64\u003c/code\u003e, \u003ccode\u003ecollections\u003c/code\u003e, \u003ccode\u003ejson\u003c/code\u003e, \u003ccode\u003emath\u003c/code\u003e, \u003ccode\u003eyaml\u003c/code\u003e, and others.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize unsupported libraries, you can import the full library source file directly into your template.\u003c/p\u003e\n"],["\u003cp\u003eSystem or network calls are strictly prohibited in templates, including any system call functionality within the supported libraries, and will result in rejection.\u003c/p\u003e\n"],["\u003cp\u003eCustom libraries are allowed but must also follow the restrictions preventing system or network calls.\u003c/p\u003e\n"]]],[],null,["# Importing Python Libraries\n\nYou can use Python libraries in your Python templates. Deployment Manager\nuploads and runs the Python code in your templates in a secure environment.\n\nYou can use libraries that are supported by Deployment Manager, listed below. To\nuse a different Python library, import the full library source in your template.\n\nSupported libraries\n-------------------\n\nDeployment Manager supports specific Python libraries that you can use in your\ntemplates. These libraries include:\n\n- [`base64`](https://docs.python.org/3/library/base64.html)\n- [`collections`](https://docs.python.org/3/library/collections.html)\n- [`encodings`](https://docs.python.org/3/library/codecs.html)\n- [`encodings.utf_8`](https://docs.python.org/3/library/codecs.html)\n- [`encodings.utf_16`](https://docs.python.org/3/library/codecs.html)\n- [`hashlib`](https://docs.python.org/3/library/hashlib.html)\n- [`json`](https://docs.python.org/3/library/json.html)\n- [`math`](https://docs.python.org/3/library/math.html)\n- [`random`](https://docs.python.org/3/library/random.html)\n- [`io`](https://docs.python.org/3/library/io.html)\n- [`sys`](https://docs.python.org/3/library/sys.html)\n- [`string`](https://docs.python.org/3/library/string.html)\n- [`time`](https://docs.python.org/3/library/time.html)\n- [`yaml`](https://github.com/yaml/pyyaml)\n- [`zipfile`](https://docs.python.org/3/library/zipfile.html)\n\n| **Caution:** Do not use system calls in your template. If a template contains any code that makes system or network calls, it is rejected. This includes any method that performs system calls using the supported libraries listed above. For example, `sys` contains a number of system calls that will automatically be rejected if you use them in your template.\n\nIf you want to import libraries that are not explicitly supported, import\nthe library using the filename. This is especially useful if you want to\nimport your own helper methods. The same restrictions for system calls apply to\ncustom libraries as well."]]