ZoneMinder / zmeventnotification

Machine Learning powered Secure Websocket & MQTT based ZoneMinder event notification server
412 stars 128 forks source link

ModuleNotFoundError: No module named 'numpy' #341

Closed kokokokokokoko closed 3 years ago

kokokokokokoko commented 3 years ago

Ubuntu server 18.04 Event Server version 6.0.6 The version of ZoneMinder you are using: 1.34.22 What is the nature of your issue Question Details I am testing event server with sudo -u www-data /usr/bin/zmeventnotification.pl --debug and getting a "No module named numpy" error when attempting to process an event.

DBG-1:2020-11-06,01:17:00 PARENT: Forked process:7268 to handle alarm eid:40
DBG-2:2020-11-06,01:17:00 |----> FORK:Front Yard (3), eid:40 Adding event path:/cams/zmevents/3/2020-11-06/40 to hook for image storage
DBG-1:2020-11-06,01:17:00 |----> FORK:Front Yard (3), eid:40 Invoking hook on event start:'/var/lib/zmeventnotification/bin/zm_event_start.sh' 40 3 "Front Yard" "Motion All" "/cams/zmevents/3/2020-11-06/40"
Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 13, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Numpy was installed via pip3 install numpy, and testing numpy in pyhton3 by hand also works.

Any information or ideas would be appreciated. Thank you!

pliablepixels commented 3 years ago

Yes. Numpy cannot be found when run as www-data.

kokokokokokoko commented 3 years ago

Thank you @pliablepixels. I found my www-data UID via cat /etc/passwd Then installed numpy with:

sudo su
cd ~
umask <UID>
pip3 install numpy

I also had to install: imutils, pyzm This seemed to work for the most part, but now I am getting: No module named 'pyzm.ZMLog' Importing by hand again works. Is there different user attempting to use this?

pliablepixels commented 3 years ago

How did you go about installing? It seems like you are not using the install script. pyzm is also used by www-data

kokokokokokoko commented 3 years ago

Thanks for the information. I installed it as detailed on this page: https://zmeventnotification.readthedocs.io/en/stable/guides/install.html

The behavior seems really odd as pyzm does not throw an error, but ZMLog does. I've still not found a solution, but contemplating a reformat/ start over since all this computer runs is ZM.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.