title: Cron python script not executing
body: <p>I  have read a few posts on this but I could not find help in them.</p>
  
  <p>I have a python script that sends mail using smtplib. It works when invoked from the command line.</p>
  
  <p>I have <code>#!/usr/bin/python</code> as the first row and can run it both using <code>/home/pi/ipsender.py</code> and <code>python /home/pi/ipsender.py</code>. </p>
  
  <p>My crontab is <code>*/1 * * * * /home/pi/ipsender.py</code> but I have also tried <code>*/1 * * * * python /home/pi/ipsender.py</code> and <code>*/1 * * * * /usr/bin/python /home/pi/ipsender.py</code>.</p>
  
  <p>Doing <code>which python</code> I get <code>/usr/bin/pyhton</code> and running python from the command line I can import and use smtplib just fine.</p>
  
  <p>In <code>/var/log/syslog</code> I get:</p>
  
  <pre><code>Nov 27 22:57:01 raspberrypi /USR/SBIN/CRON[3764]: (pi) CMD (python /home/pi/ipsender.py)
  Nov 27 22:57:01 raspberrypi /USR/SBIN/CRON[3763]: (CRON) info (No MTA installed, discarding output)
  </code></pre>
  
  <p>And I'm guessing the No MTA... is just about Cron not sending emails about what it's doing, or isn't it?</p>
  
  <p>How do I run this script.</p>
  
  <p>[Edit]</p>
  
  <p>The permission of the script is </p>
  
  <pre><code>-rwxr-xr-x 1 pi   pi       551 Nov 27 22:37 ipsender.py
  </code></pre>
  
  <p>[Edit2]
  Using the tip from D Read I'm getting the following log</p>
  
  <pre><code>starting
  Traceback (most recent call last):
    File "/home/pi/ipsender.py", line 7, in &lt;module&gt;
      ifconfig_output = sp.check_output(["ifconfig", "wwan0"])
    File "/usr/lib/python2.7/subprocess.py", line 537, in check_output
      process = Popen(stdout=PIPE, *popenargs, **kwargs)
    File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
      errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  </code></pre>
  
  <p>Suggesting to me that there is something with the path. Although in <code>/etc/crontab</code> I have <code>PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin</code> and <code>which ifconfig</code> gives <code>/sbin/ifconfig</code>. So that should not be a problem right?</p>