I'm trying to use a crontab to execute a python script periodically. I followed the solution given here to execute the command using virtualenv. Following is my crontab
SHELL=/bin/bash
HOME=/
MAILTO="myid@example.com"
* * * * * cd /home/jaskaran/edmhunters && /home/jaskaran/edmhunters/env/bin/python /home/jaskaran/edmhunters/scripts/db/songlist.py
I keep getting this ImportError
Traceback (most recent call last):
File "/home/jaskaran/edmhunters/scripts/db/songlist.py", line 4, in <module>
from hunt.models import DJ, Song
ImportError: No module named hunt.models
The script works fine when run from the shell. What am I missing?