I have a python script which is executed every 5 minutes by the OS.
The problem is it needs to first activate the jdate
virtual I have created for it in /tmp
to be able to use the jdatetime
module installed there.
I have tried both #1 and #2 but no success. Executing the script in the terminal gives me errors.
#!/usr/bin/env python
# 1:
import os
os.system(f"cd /tmp ; source jdate/bin/activate")
# returns error: ModuleNotFoundError: No module named 'jdatetime'
# 2:
import subprocess
subprocess.check_output(f"cd /tmp ; source jdate/bin/activate", shell=True)
# returns error: ModuleNotFoundError: No module named 'jdatetime'