Forums

Scheduled tasks not running

I just signed up for pythonanywhere yesterday and have set up a few scheduled tasks. If I run these manually from bash, they work perfectly well. However, when scheduled, they do not work.

The command I am using for one of them is /home/jrroelle/hasoffers/test_email.py. When viewing the log for the task, it says that it ran with a response code of 0. However, as this is meant to send an email, I can check easily if it was successful or not.

I'm not sure what to do.

EDIT: solved

I needed to begin my files with #!/usr/local/bin/python3.4

Thanks for posting the solution!

How were you running them from bash? It's kind of odd that you got different behaviour, especially with a zero exit code.

I was running them as $python3 file_name.py. I didn't realize the default behavior for scheduled tasks is python2.7.

Ah, I see. Thanks for the update!