O Cloud Deployment Manager vai chegar ao fim do suporte em 31 de dezembro de 2025. Se você usa o Deployment Manager, migre para o Infrastructure Manager ou uma tecnologia de implantação alternativa até 31 de dezembro de 2025 para garantir que seus serviços continuem sem interrupções.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Você pode usar as bibliotecas do Python nos modelos dessa linguagem. O Deployment Manager faz upload e executa o código do Python nos modelos em um ambiente seguro.
Você pode usar as bibliotecas permitidas pelo Deployment Manager, conforme listado a seguir. Para usar uma biblioteca diferente do Python, importe a origem da biblioteca completa no modelo.
Bibliotecas permitidas
O Deployment Manager permite bibliotecas específicas do Python que você pode usar nos modelos. Essas bibliotecas incluem:
Se quiser importar bibliotecas sem suporte explícito, importe a biblioteca usando o nome do arquivo. Isso é especialmente útil quando você quer importar seus próprios métodos auxiliares. As mesmas restrições a chamadas de sistema também se aplicam a bibliotecas personalizadas.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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."]]