【问题标题】:WebJob Python Error ImportError: Missing required dependencies ['numpy']WebJob Python 错误 ImportError:缺少必需的依赖项 ['numpy']
【发布时间】:2019-07-29 13:01:06
【问题描述】:

当我尝试安排一个 Python 文件时,我遇到了以下错误,该文件被压缩到一个包含其库的文件夹中。

该文件只使用了pandas库,但是numpy是它的一个依赖,所以我复制了pandas所有依赖的文件夹,比如pandas、numpy、dateutil、pytz。

但我不断收到错误消息,只是在 WEBJOB、WEB APP AZURE 上,但我的 PC 上的位置工作正常。

[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

请问,谁能帮帮我?

【问题讨论】:

  • 您好,您还有其他问题吗?如果答案对您有用,请帮助将其标记为答案。谢谢。

标签: python azure numpy web-applications webjob


【解决方案1】:

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

1.Nav 到 azure 门户 -> 您的 Web 应用程序 -> 在左侧刀片中,选择 Extensions -> 然后添加 python 扩展名(您使用的那个):

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

导航到 kudu 网站:

在 kudu 站点中,点击 Debug Console -> CMD,将目录更改为 D:\home\python364x64

【讨论】:

  • 我已按照您的步骤操作,但仍收到ImportError: Missing required dependencies ['numpy']。你知道问题是什么吗? numpynumpy-1.16.4.dist-info 文件夹现在位于 D:\home\python364x64\Lib\site-packages
猜你喜欢
  • 1970-01-01
  • 2017-07-01
  • 1970-01-01
  • 2017-06-11
  • 2020-01-19
  • 1970-01-01
相关资源
最近更新 更多