gpt4 book ai didi

azure - 在 Azure 函数代码中使用 Python 包

转载 作者:行者123 更新时间:2023-12-02 23:12:30 28 4
gpt4 key购买 nike

我创建了一个 Azure 函数,并希望能够在该函数的 Python 代码中使用各种包;以 Numpy 为例。显然,一旦代码发布到 Azure,它就不会在我的本地计算机上运行。这意味着我无法将 Numpy 安装到它运行的任何基础设施上,因此我无法在代码中导入 Numpy。如何在代码中使用像 Numpy 这样的包?

最佳答案

来自官方文档:

Dependencies are obtained remotely based on the contents of the requirements.txt file

您需要做的就是创建该文件并将其与您的函数代码一起上传

https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python#python-version-and-package-management

关于azure - 在 Azure 函数代码中使用 Python 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59636474/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com