Forums

Scheduled Task is not running

Hi guys -

I have a scheduled task that I am trying to run, the following is my error when I view the log:

Traceback (most recent call last): File "/home/nextlevelmarketing/zillow/clay_script.py", line 1, in <module> from urllib.request import urlopen ImportError: No module named request

2015-12-05 11:00:45 -- Completed task, took 5.00 seconds, return code was 1.

I believe this is caused because I programed this for python 3.4 and the default is python 2.7 --- is there any way to change the default or is there another reason that this could be happening.

Thanks ES

Looks like that server was having a little trouble. I've given it a good talking to, so it should behave better now.

rofl ---thanks Glenn

Glenn:

My scheduled task is still not running, below is the error:

Traceback (most recent call last): File "/home/nextlevelmarketing/zillow/johnson_script.py", line 1, in <module> from urllib.request import urlopen ImportError: No module named request

2015-12-08 10:01:10 -- Completed task, took 1.00 seconds, return code was 1.

It runs when I do it manually from a Python 3.4 window --- I assume this has to do with a version issue.

ES

Which Python version are you trying to use? It might be worth setting it explicitly. You could either use a hashbang:

#!/usr/bin/python3.4

as the first line of your script

Or just put it into the task for the command-line:

python3.4 /home/nextlevelmarketing/zillow/johnson_script.py

Or, if you want to use a virtualenv, put the full path to your virtualenv python:

/home/nextlevelmarketing/.virtualenvs/my-virtualenv/bin/python /home/nextlevelmarketing/zillow/johnson_script.py

Thanks Harry -

Question solved.

ES