openenergymonitor / EmonScripts

Emoncms Stack Installation and Update scripts
16 stars 30 forks source link

[Improvements] no redis pip3 module #124

Closed nobless closed 3 years ago

nobless commented 4 years ago

● service-runner.service - Emoncms service-runner Input Script Loaded: loaded (/var/www/emoncms/scripts/services/service-runner/service-runner.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2020-11-01 03:20:14 EET; 22s ago Docs: https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-runner-update.md Process: 21296 ExecStart=/usr/bin/python3 /var/www/emoncms/scripts/services/service-runner/service-runner.py (code=exited, status=1/FAILURE) Main PID: 21296 (code=exited, status=1/FAILURE) pi@ubuntu18:/opt/openenergymonitor/EmonScripts/install$ /usr/bin/python3 /var/www/emoncms/scripts/services/service-runner/service-runner.py Traceback (most recent call last): File "/var/www/emoncms/scripts/services/service-runner/service-runner.py", line 13, in import redis ModuleNotFoundError: No module named 'redis'

Should be:

ExecStart=/usr/bin/python /var/www/emoncms/scripts/services/service-runner/service-runner.py

as now it tries to run without redis module. also script should be updated to be compatible with python2:

/opt/openenergymonitor/EmonScripts/install$ python /var/www/emoncms/scripts/services/service-runner/service-runner.py File "/var/www/emoncms/scripts/services/service-runner/service-runner.py", line 23 print("Connected to redis server", flush=True) ^ SyntaxError: invalid syntax

or second solution

sudo apt install python3-pip sudo pip3 install redis

if the second solution will be prefered, then I suggest installing all pip3 modules, not pip (python2) modules in which way now script acts.

Please include in code :)

TrystanLea commented 3 years ago

These have now been updated to use python3: https://github.com/openenergymonitor/EmonScripts/blob/master/install/main.sh#L64 https://github.com/openenergymonitor/EmonScripts/blob/master/install/redis.sh#L20