admin管理员组文章数量:1122832
I want to run a Python job in an Azure App Service WebJob. The App Service plan is Basic. The OS is Linux, and the runtime is Python. The deployment model is set to “Code.”
I created a WebJob by uploading a ZIP file containing a simple Python script.
However, when I run the WebJob, an error occurs. Looking at the error logs, I see messages like the following:
[11/18/2024 23:23:22 > d7204e: SYS INFO] Status changed to Initializing
[11/18/2024 23:23:22 > d7204e: SYS INFO] Run script 'run.py' with script host - 'PythonScriptHost'
[11/18/2024 23:23:22 > d7204e: SYS INFO] Status changed to Running
[11/18/2024 23:23:22 > d7204e: ERR ] An error occurred trying to start process 'python.exe' with working directory '/tmp/jobs/triggered/webjobpy/bphw5fzr.pno/webjobtest'. No such file or directory
Looking at the error message, it says that python.exe cannot be found, and I suspect that might be the issue.
I have confirmed that the OS is set to Linux.
Is there any solution for this? Or is it that Python jobs are not supported in WebJobs?
I expected the Python job to run successfully since Python should be supported in WebJobs.
I want to run a Python job in an Azure App Service WebJob. The App Service plan is Basic. The OS is Linux, and the runtime is Python. The deployment model is set to “Code.”
I created a WebJob by uploading a ZIP file containing a simple Python script.
However, when I run the WebJob, an error occurs. Looking at the error logs, I see messages like the following:
[11/18/2024 23:23:22 > d7204e: SYS INFO] Status changed to Initializing
[11/18/2024 23:23:22 > d7204e: SYS INFO] Run script 'run.py' with script host - 'PythonScriptHost'
[11/18/2024 23:23:22 > d7204e: SYS INFO] Status changed to Running
[11/18/2024 23:23:22 > d7204e: ERR ] An error occurred trying to start process 'python.exe' with working directory '/tmp/jobs/triggered/webjobpy/bphw5fzr.pno/webjobtest'. No such file or directory
Looking at the error message, it says that python.exe cannot be found, and I suspect that might be the issue.
I have confirmed that the OS is set to Linux.
Is there any solution for this? Or is it that Python jobs are not supported in WebJobs?
I expected the Python job to run successfully since Python should be supported in WebJobs.
Share Improve this question edited Nov 22, 2024 at 0:08 okake asked Nov 21, 2024 at 23:32 okakeokake 32 bronze badges 4 |2 Answers
Reset to default 0python Run script 'run.py' with script host - 'PythonScriptHost' [11/18/2024 23:23:22 > d7204e: SYS INFO] Status changed to Running [11/18/2024 23:23:22 > d7204e: ERR ] An error occurred trying to start process 'python.exe' with working directory '/tmp/jobs/triggered/webjobpy/bphw5fzr.pno/webjobtest'. No such file or directory
Even I got same Error when I used run.py
as the Python file name.
The WebJobs service treated run.py
as the entry point but did not find any runnable scripts in the file, which caused an error.
I created a simple Python WebJob with a file name different from run.py
.
webjob. py:
print("Hello, world!")
script. sh:
python3 run.py
WebJob Output:
Thanks for letting us know, we recently added support for WebJobs in Linux and it is in Preview at the moment.
We will make sure the 'PythonScriptHost' works well for GA.
本文标签: How to Resolve Errors When Running Python Jobs in Azure App Service WebJobsStack Overflow
版权声明:本文标题:How to Resolve Errors When Running Python Jobs in Azure App Service WebJobs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736306557a1932999.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
#!/usr/bin/env python3
at top of the run.py. – Aslesha Kantamsetti Commented Nov 22, 2024 at 0:34#!/usr/bin/env python3
at the top of run.py and tried running it, but I’m still getting the same error. I feel it’s strange that the OS is Linux, yet the error says,“start process with ‘python.exe’”.
– okake Commented Nov 22, 2024 at 2:15