alexleavitt
07-11-2012, 12:34 PM
I'm running a small Python script to dump data into a MySQL database. Recently I installed Python 2.7 and set all my PATHs so that when I SSH into my home directory and run
python /scripts/script.py
it populates the database perfectly.
However, when I set up a cron job with the same script, it throws this error:
Traceback (most recent call last):
File "scripts/database.py", line 6, in <module>
import requests
ImportError: No module named requests
I have no clue what's wrong; I'm pretty new to programming. A bunch of my more-knowledgable programmer acquaintances suggested cron may be under a different user that doen't have the same PATH.
Any suggestions?
python /scripts/script.py
it populates the database perfectly.
However, when I set up a cron job with the same script, it throws this error:
Traceback (most recent call last):
File "scripts/database.py", line 6, in <module>
import requests
ImportError: No module named requests
I have no clue what's wrong; I'm pretty new to programming. A bunch of my more-knowledgable programmer acquaintances suggested cron may be under a different user that doen't have the same PATH.
Any suggestions?