Can't call Python 3 from cPanel cron jobs

1k Views Asked by At

I add this in my cpanel cron jobs

python3.7 myscript.py

But I get this error

/usr/local/cpanel/bin/jailshell: python3.7: command not found

But I can call python3.7 myscript.py from the command line just fine. How can I run it in cPanel cron jobs?

1

There are 1 best solutions below

1
On

Solved. I use the full path. It seems it is caused by me using a different user than root since I use cPanel. Weird it didn't happen when I use just python when I used Python 2.

/usr/local/bin/python3.7 myscript.py