Crontab | Missing Python Module

The right way would be

*/1 * * * * PYTHONPATH=/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages python /Users/JohnDoe/Desktop/createUpdate.py

Please be aware of spaces in variable assignment. No semicolon and no need to export variables, since declaring them before the commands already makes them active for the command itself.


Use

*/1 * * * * PYTHONPATH=/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages python /Users/JohnDoe/Desktop/createUpdate.py 

in your crontab. No semi-colons, PYTHONPATH only applies to that instance of python and your script.

(Further, I think you got the

/bin/sh: PYTHONPATH: command not found

error because you have a space between PYTHONPATH and the equal sign.)

Tags:

Python

Crontab