Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45509

Re: python script is not running

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: python script is not running
Date 2013-05-18 09:44 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-FB5354.09442518052013@news.panix.com> (permalink)
References <bb111639-6a94-4151-a153-9bbebe75a4ea@googlegroups.com> <mailman.1801.1368883685.3114.python-list@python.org>

Show all headers | View raw


In article <mailman.1801.1368883685.3114.python-list@python.org>,
 Chris Angelico <rosuav@gmail.com> wrote:

> On Sat, May 18, 2013 at 8:12 PM, Avnesh Shakya <avnesh.nitk@gmail.com> wrote:
> > avin@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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python script is not running Avnesh Shakya <avnesh.nitk@gmail.com> - 2013-05-18 03:12 -0700
  Re: python script is not running Chris Angelico <rosuav@gmail.com> - 2013-05-18 23:28 +1000
    Re: python script is not running Roy Smith <roy@panix.com> - 2013-05-18 09:44 -0400
  Re: python script is not running Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-18 12:35 -0400
  Re: python script is not running woooee <woooee@gmail.com> - 2013-05-18 10:35 -0700
    Re: python script is not running Chris Angelico <rosuav@gmail.com> - 2013-05-19 03:59 +1000
    Re: python script is not running Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-05-18 20:43 +0200
    Re: python script is not running Chris Angelico <rosuav@gmail.com> - 2013-05-19 09:33 +1000

csiph-web