从系统调度程序运行时 Python 不存在

发布于 2024-10-06 14:52:07 字数 156 浏览 0 评论 0原文

我制作了一个运行 Python 应用程序的批处理脚本。这个批处理脚本是由一个叫做System Scheduler的程序触发的,但是当程序运行批处理脚本时,却说Python不存在。

当我手动运行批处理脚本时,没有收到任何错误。

任何人都可以解释这一点或提出解决方案吗?

I have made a batch script which runs a Python application. This batch script is triggered by a program called System Scheduler, but when the program runs the batch script, it says that Python is not exisiting.

When I run my batch script manually, I get no error.

Can anyone explain this or come up with a solution?

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

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

发布评论

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

评论(2

薔薇婲 2024-10-13 14:52:07

从调度程序调用时,$PATH 可能未正确设置。 命令更改为

python yourscript.py

尝试将名为from 的

/usr/bin/python yourscript.py

(替换系统上 python 的实际路径,您可以使用以下命令找到该路径:

$ which python

Probably the $PATH is not set properly when called from scheduler. Try changing the command called from

python yourscript.py

to

/usr/bin/python yourscript.py

(Substitute the actual path to python on your system, which you can find with:

$ which python
柏拉图鍀咏恒 2024-10-13 14:52:07

检查系统调度程序正在运行的用户上下文,并确保 Python 的位置位于其 PATH 中。

Check the user context that System Scheduler is running under and ensure the location of Python is in it's PATH.

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