Forums

Scheduled Tasks Started Failing with Exit Code 127

Hi,

I’ve got an hourly scheduled task that ran fine up until Oct 19. After that, every run fails with:

/bin/bash: python: command not found return code was 127

Nothing in the script changed.

The task command is always has been:

/path/to/venv/bin/python3.10 /path/to/script.py

I also tested:

python3.10 /path/to/script.py

In both cases, the task output still shows it’s trying to run python and then exits immediately with 127. My script never actually runs. So it looks like the scheduler is prepending python in front of whatever command I give it, instead of running that command directly.

This worked before Oct 19, then stopped.

How can I solve this so the scheduled task actually runs my script again, instead of trying to call python?

Thanks.

That happens when you break the PATH environment variable. To restore the PATH to a useable value, delete your .bashrc and .bash_profile files and then start a new console to re-create them

Thank you! That solved it.