Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我制作了一个运行 Python 应用程序的批处理脚本。这个批处理脚本是由一个名为 System Scheduler 的程序触发的,但是当程序运行批处理脚本时,它说 Python 不存在。
当我手动运行我的批处理脚本时,我没有收到任何错误。
任何人都可以解释这一点或提出解决方案吗?
从调度程序调用时,可能没有正确设置 $PATH。尝试更改调用的命令
python yourscript.py
至
/usr/bin/python yourscript.py
(替换系统上 python 的实际路径,您可以使用以下命令找到:
$ which python
检查系统调度程序运行的用户上下文,并确保 Python 的位置在它的 PATH 中。