Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This boils down to the actual python interpreter in use at the time cron executes the script in all likelihood, so here's how to narrow that down: </p> <p>Open up /Users/paulo/Desktop/ashtanga/ping/sender.py and see if there's a line at the top starting with '#!'. This is the version of Python that is invoked when you run the script at the command line <em>if you don't invoke it with an explicit interpreter</em>. So, if that line says "#!/usr/bin/python", and you run it at the command line like this:</p> <pre><code>$ /Users/paulo/Desktop/ashtanga/ping/sender.py </code></pre> <p>(Where '$' is the command line prompt)</p> <p>Then /usr/bin/python is the interpreter binary being invoked. If the script works when you run it this way, then you want to make sure that /usr/bin/python is the interpreter being invoked by cron when it runs your job. </p> <p>However, outside of an explicit Python interpreter indicated in a '#!' line (called a 'shebang' line in some circles), two other possibilities exist: </p> <p>First, the shebang line might say '#!/usr/bin/env python', which means 'use whatever Python interpreter is the first one found when you search the directories in the user's $PATH environment variable'. You don't want to rely on that when you run from cron, so you want to specify an explicit path to a Python interpreter. You're already doing that, but you need to make sure that if you launch /usr/bin/python at the command line, it can successfully import django. If it can't, you need to find which one does, and specify that one in your cron job. </p> <p>Second, there might be no shebang line at all in the script, in which case you also <em>must</em> specify an interpreter in your cron job. See above :) </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload