当我尝试安排一个压缩到包含其库的文件夹内的 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 扩展(您使用的扩展):
- 然后导航到 kudu 站点(
https://your_web_app_name.scm.azurewebsites.net
) -> 在顶部的调试控制台中,选择 CMD -> 然后导航到 python 安装目录(就我而言,它是 D:\home\python364x64>) -> 然后执行 cmd"pip install numpy"
导航到 kudu 站点:
在 kudu 站点中,单击调试控制台 -> CMD,并将目录更改为 D:\home\python364x64
关于python - WebJob Python 错误 ImportError : Missing required dependencies ['numpy' ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55047227/