Azure在Python运行时起作用。 H2O模块没有错误

发布于 2025-02-13 14:30:05 字数 856 浏览 0 评论 0原文

我正在尝试创建使用H20模块的Azure Python函数。当我尝试在本地测试它时,即使我已经在sumplions.txt中指定了它,但它似乎没有可用的错误,并且它似乎已安装在虚拟env中,并且可以手动使用虚拟环境运行。

最小python代码:

import datetime
import logging

import h2o
import azure.functions as func

def main(mytimer: func.TimerRequest) -> None:
    utc_timestamp = datetime.datetime.utcnow().replace(
        tzinfo=datetime.timezone.utc).isoformat()
    if mytimer.past_due:
        logging.info('The timer is past due!')
    logging.info('Python timer trigger function ran at %s', utc_timestamp)

要求.txt

h2o==3.32.0.2

error.txt:

Python版本3.9M Windows 10 OS。

I am trying to create an Azure python function which uses H20 module. When I tried to test it locally I am getting module not available error even though I have specified it in requirements.txt and it seem to be installed in the virtual env and I am able to run using virtual environment manually.

Minimal Python code:

import datetime
import logging

import h2o
import azure.functions as func

def main(mytimer: func.TimerRequest) -> None:
    utc_timestamp = datetime.datetime.utcnow().replace(
        tzinfo=datetime.timezone.utc).isoformat()
    if mytimer.past_due:
        logging.info('The timer is past due!')
    logging.info('Python timer trigger function ran at %s', utc_timestamp)

requirement.txt

h2o==3.32.0.2

Error.txt:
enter image description here

Python version 3.9m Windows 10 OS.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

压抑⊿情绪 2025-02-20 14:30:05
  1. 在VS代码中创建了Azure Python计时器触发函数。
  2. 在VS代码项目终端中安装了以下依赖项:
pip install requests
pip install tabulate
pip install future
  1. 如果可用任何现有版本或以前的版本,请使用以下命令卸载它:
  2. on
pip install -f http://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o

此处//i.sstatic.net/2m1gc.png“ alt =“在此处输入图像描述”>

带有版本H2O == 3.32.0.2,我在VS代码输出终端中也获得了相同的例外。
因此,我尝试了以下版本并运行良好。

要求.txt文件

azure-functions
h2o==3.36.1.2

结果

>还可以使用版本 3.14.0.0.0.0.2 H2O模块

  1. Created the Azure Python Timer Trigger Function in VS Code.
  2. Installed the below dependencies in the VS Code Project terminal:
pip install requests
pip install tabulate
pip install future
  1. If any existing or previous versions of H2o is available, uninstall it using the below command:
    enter image description here
  2. Next, run this command to install H2o module in the Project integrated terminal:
pip install -f http://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o

enter image description here

With the version of h2o==3.32.0.2, I also got the same exceptions in VS Code output terminal.
So, I have tried with the below versions and working well.

requirements.txt file:

azure-functions
h2o==3.36.1.2

Result:

enter image description here

It also working with the version 3.14.0.2 H2o module in Python.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文