[[["容易理解","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 (世界標準時間)。"],[[["\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."]]