2

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?

Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108

1 Answers1

2

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
Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
  • I had the same problem. Command worked fine from the terminal but not as a cron job. Namecheap's docs say "For Python and Perl scripts, there is no need to use a full path to the environment" -- but it only worked when I included the full path, in my case when using a venv. Thanks. – alstr May 12 '20 at 08:50