Forums

Error when running a scheduled task.

I have a working script that uses the pygsheets module. This module is installed, the script runs and works when run manually from python console. However when scheduled as a task it reports an error ImportError: No module named pygsheets. What could be the problem?

Are you specifying the Python version in the scheduled task setup -- for example, python3.5 /home/kunule8/myscript.py instead of python /home/kunule8/myscript.py or just /home/kunule8/myscript.py? If you're not, it might be that the task scheduler is misidentifying which version to use.

My bad, i forgot to include the python version. I have updated the script path to include python version and it works. Thanks.

No problem, glad to help!