gpt4 book ai didi

python - 在 Azure Functions 中使用 Pandas

转载 作者:行者123 更新时间:2023-12-02 06:02:17 24 4
gpt4 key购买 nike

尝试创建一个基本的Python函数并在Azure函数应用程序中使用它(基于消耗)。通过 VS Code 使用 HTTP 模板,并能够在 Azure 上使用和部署它。然而,当我尝试在逻辑中使用“Pandas”时,我收到了无法纠正的错误。我是Python的菜鸟。您能建议如何纠正吗?

使用的工具:VS Code、Azure Functions 工具本地安装的Python版本:3.8.5Azure函数应用程序Python版本:3.8

enter image description here

enter image description here

最佳答案

您在 Azure 上的函数中似乎尚未安装 pandas 模块。您需要将 pandas 模块添加到本地 requirements.txt 中,然后将函数从本地部署到 azure。它将根据 requirements.txt 中的行安装模块。

您可以在“终端”窗口中运行此命令,以自动在 requirements.txt 中生成 pandas 行。

pip freeze > requirements.txt

运行上面的命令后,您的 requirements.txt 应如下所示:

enter image description here

关于python - 在 Azure Functions 中使用 Pandas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63500963/

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