I am testing a (python) bot script before using it with crontab. I was advised to run a shell script that runs the python script in the crontab. In order for the shell script to run, I need to activate the venv. This is where the problem is. When I try to run run_socialbot.py, I get:
Traceback (most recent call last):
File "/home/gsb/socialbot.py", line 3, in <module>
from instapy import InstaPy
ModuleNotFoundError: No module named 'instapy'
Even though instapy is installed in the venv. And when I open up the interpreter with "python3" and try to import instapy while the venv is activated, it works fine. Here is the shell script code:
#! /bin/bash
source /home/gsb/venv/bin/activate
/usr/bin/python3 /home/gsb/socialbot.py
Can anyone help out? thanks in advance
I'm running this at a digitalocean server. Ubuntu 20.04