THIS IS A SELF ANSWER TICKET YOU CAN CLOSE I RECORD IF USEFUL FOR OTHERS
I would like to test mycodo controllers from the command line to quick check syntax errors in my python code. I proceed like this:
pi@raspberrypi:~ $ python3 /home/pi/Mycodo/mycodo/user_python_code/conditional_045edd83-4918-4ef5-beda-fa11a3b5c52c.py
Traceback (most recent call last):
File "/home/pi/Mycodo/mycodo/user_python_code/conditional_045edd83-4918-4ef5-beda-fa11a3b5c52c.py", line 4, in <module>
from mycodo.controllers.base_conditional import AbstractConditional
File "/var/mycodo-root/mycodo/controllers/base_conditional.py", line 13, in <module>
from mycodo.config import MYCODO_DB_PATH
File "/var/mycodo-root/mycodo/config.py", line 10, in <module>
from flask_babel import lazy_gettext as lg
ModuleNotFoundError: No module named 'flask_babel'
It looks like I am not in the mycodo virtual environment, but I cannot find it with these commands:
THIS IS A SELF ANSWER TICKET YOU CAN CLOSE I RECORD IF USEFUL FOR OTHERS
I would like to test mycodo controllers from the command line to quick check syntax errors in my python code. I proceed like this:
It looks like I am not in the mycodo virtual environment, but I cannot find it with these commands:
I know it is here
~/Mycodo/env
.Solution is to use python inside Mycodo env like this:
sudo ~/Mycodo/env/bin/python /home/pi/Mycodo/mycodo/user_python_code/conditional_045edd83-4918-4ef5-beda-fa11a3b5c52c.py