My aim is to run a script daily that updates a google sheet with data from Google Analytics.
When I run the code on my VM instance it returns an error:
ModuleNotFoundError: No module named 'googleapiclient'
The module is installed and if I run:
$ source [project-name]/bin/activate
on the VM then call my script it works and the update is done.
I am trying to set the script to run daily, I tried to set it up using crontab: (for testing i used every 5 mins)
I tried:
*/5 * * * * python3 myscript.py
and
*/5 * * * * $ python3 myscript.py
and
*/5 * * * * source [project-name]/bin/activate
*/5 * * * * python3 myscript.py
This is the first time I am trying to set up a crontab job, so any debugging suggestions are appreciated as well.