python script is not running
Roy Smith
roy at panix.com
Sat May 18 09:44:25 EDT 2013
In article <mailman.1801.1368883685.3114.python-list at python.org>,
Chris Angelico <rosuav at gmail.com> wrote:
> On Sat, May 18, 2013 at 8:12 PM, Avnesh Shakya <avnesh.nitk at gmail.com> wrote:
> > avin at hp:~$ crontab -e
> > then type -
> > */2 * * * * python /home/avin/data/try.py
> >
>
> You may need to put an explicit path to your Python interpreter. Type:
>
> $ which python
>
> and put that into your crontab.
True. Somewhat more generally, jobs run under cron have a far more
barren environment than most people realize. Or, looking at it a
different way, most people don't even realize all the ways they depend
on their environment being set up properly by the login process.
If you've set things like PYTHONPATH, you won't have them set right for
cron jobs unless you explicitly reset them in your crontab.
It's often instructive to run something like "env > /tmp/xxx" under
cron, and compare that to what you get when you run "env" at a
command-line prompt.
More information about the Python-list
mailing list