python - WebJob Python 错误 ImportError : Missing required dependencies ['numpy' ]

标签 python azure numpy web-applications webjob

当我尝试安排一个压缩到包含其库的文件夹内的 Python 文件时,出现以下错误。

该文件仅使用pandas库,但numpy是它的依赖项,因此我复制了pandas所有依赖项的文件夹,例如pandas,numpy,dateutil,pytz。

但我不断收到错误,只是在 WEBJOB、WEB 应用程序 AZURE 上,但我的电脑上的位置工作正常。

[03/07/2019 14:39:00 > a4d03a: SYS INFO] Status changed to Initializing
[03/07/2019 14:39:01 > a4d03a: SYS INFO] Job directory change detected: Job file 'testeWEBJOB\test.py' timestamp differs between source and working directories.
[03/07/2019 14:39:28 > a4d03a: SYS INFO] Run script 'test.py' with script host - 'PythonScriptHost'
[03/07/2019 14:39:28 > a4d03a: SYS INFO] Status changed to Running
[03/07/2019 14:39:29 > a4d03a: ERR ] Traceback (most recent call last):
[03/07/2019 14:39:29 > a4d03a: ERR ]   File "test.py", line 1, in <module>
[03/07/2019 14:39:29 > a4d03a: ERR ]     import pandas as pd
[03/07/2019 14:39:29 > a4d03a: ERR ]   File "D:\local\Temp\jobs\triggered\TESTE\zqwhvklh.hch\testeWEBJOB\pandas\__init__.py", line 19, in <module>
[03/07/2019 14:39:29 > a4d03a: ERR ]     "Missing required dependencies {0}".format(missing_dependencies))
[03/07/2019 14:39:29 > a4d03a: ERR ] ImportError: Missing required dependencies ['numpy']
[03/07/2019 14:39:29 > a4d03a: SYS INFO] Status changed to Failed
[03/07/2019 14:39:29 > a4d03a: SYS ERR ] Job failed due to exit code 1

请问有人可以帮我吗?

最佳答案

您可以按照以下步骤操作:

1.导航到 Azure 门户 -> 您的 Web 应用程序 -> 在左侧边栏选项卡中,选择“扩展” -> 然后添加 Python 扩展(您使用的扩展):

enter image description here

enter image description here

  • 然后导航到 kudu 站点(https://your_web_app_name.scm.azurewebsites.net) -> 在顶部的调试控制台中,选择 CMD -> 然后导航到 python 安装目录(就我而言,它是 D:\home\python364x64>) -> 然后执行 cmd "pip install numpy"
  • 导航到 kudu 站点:

    enter image description here

    在 kudu 站点中,单击调试控制台 -> CMD,并将目录更改为 D:\home\python364x64

    enter image description here

    关于python - WebJob Python 错误 ImportError : Missing required dependencies ['numpy' ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55047227/

    相关文章:

    python - 如何在 python 中加载 *.obj 文件并对其应用纹理

    azure - 在 Microsoft Azure 服务总线中使用 TopicClient/QueueClient.sendAsync(IList<Message>) 发送的消息列表的大小限制 - 2020

    azure - Azure 函数中针对 Cosmos DB 的 SQL 注入(inject)

    python - 查找表示图像的屏蔽 ndarray 的中值

    Raspbian 上的 Python - "TypeError: ' numpy.int3 2' object is not iterable'“

    python - 加速索引 "revert"

    python - 将元组列表转换为具有键的多个字典值的字典

    python - 合并数据框和重复值

    python - 如何总计一个while循环?

    python - 如何通过Python使用批量转录API