ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
JCAK
Posts: 9
Joined: Mon Dec 20, 2021 2:56 am

ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by JCAK »

Hi

I'm trying a Zoneminder 1.36.x and Zmeventnotification (latest version) on ubuntu 18.04.6. All from scratch.

I installed python3.7 and python3-pip and then followed the steps on the links below:

https://zoneminder.readthedocs.io/en/la ... -04-bionic

https://zmeventnotification.readthedocs ... stall.html

ZM works fine, but when I try to install ZME all steps run ok until execute

Code: Select all

sudo./install.sh
The process starts well but after ask me

Code: Select all

Install Hook [y / N]: y
and download some modules ends with the message:

ModuleNotFoundError: No module named 'numpy'
sudo: pip3: command not found
ERROR:python hooks setup failed

Code: Select all

*** Installing Hooks ***
Checking for YoloV3 data files....
--2021-12-11 01:09:02--  https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3.cfg
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8342 (8.1K) [text/plain]
Saving to: '/var/lib/zmeventnotification/models/yolov3/yolov3.cfg'

/var/lib/zmeventnotification/models/yolov3/y 100%[=============================================================================================>]   8.15K  --.-KB/s    in 0s

2021-12-11 01:09:03 (16.6 MB/s) - '/var/lib/zmeventnotification/models/yolov3/yolov3.cfg' saved [8342/8342]

--2021-12-11 01:09:03--  https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 625 [text/plain]
Saving to: '/var/lib/zmeventnotification/models/yolov3/coco.names'

/var/lib/zmeventnotification/models/yolov3/c 100%[=============================================================================================>]     625  --.-KB/s    in 0s

2021-12-11 01:09:03 (52.7 MB/s) - '/var/lib/zmeventnotification/models/yolov3/coco.names' saved [625/625]

--2021-12-11 01:09:03--  https://pjreddie.com/media/files/yolov3.weights
Resolving pjreddie.com (pjreddie.com)... 128.208.4.108
Connecting to pjreddie.com (pjreddie.com)|128.208.4.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 248007048 (237M) [application/octet-stream]
Saving to: '/var/lib/zmeventnotification/models/yolov3/yolov3.weights'

/var/lib/zmeventnotification/models/yolov3/y 100%[=============================================================================================>] 236.52M  2.35MB/s    in 1m 49s

2021-12-11 01:10:53 (2.17 MB/s) - '/var/lib/zmeventnotification/models/yolov3/yolov3.weights' saved [248007048/248007048]


Checking for TinyYOLOV3 data files...
--2021-12-11 01:10:53--  https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3-tiny.cfg
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1915 (1.9K) [text/plain]
Saving to: '/var/lib/zmeventnotification/models/tinyyolov3/yolov3-tiny.cfg'

/var/lib/zmeventnotification/models/tinyyolo 100%[=============================================================================================>]   1.87K  --.-KB/s    in 0s

2021-12-11 01:10:54 (40.3 MB/s) - '/var/lib/zmeventnotification/models/tinyyolov3/yolov3-tiny.cfg' saved [1915/1915]

--2021-12-11 01:10:54--  https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 625 [text/plain]
Saving to: '/var/lib/zmeventnotification/models/tinyyolov3/coco.names'

/var/lib/zmeventnotification/models/tinyyolo 100%[=============================================================================================>]     625  --.-KB/s    in 0s

2021-12-11 01:10:54 (53.7 MB/s) - '/var/lib/zmeventnotification/models/tinyyolov3/coco.names' saved [625/625]

--2021-12-11 01:10:54--  https://pjreddie.com/media/files/yolov3-tiny.weights
Resolving pjreddie.com (pjreddie.com)... 128.208.4.108
Connecting to pjreddie.com (pjreddie.com)|128.208.4.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35434956 (34M) [application/octet-stream]
Saving to: '/var/lib/zmeventnotification/models/tinyyolov3/yolov3-tiny.weights'

/var/lib/zmeventnotification/models/tinyyolo 100%[=============================================================================================>]  33.79M  1.68MB/s    in 18s

2021-12-11 01:11:13 (1.89 MB/s) - '/var/lib/zmeventnotification/models/tinyyolov3/yolov3-tiny.weights' saved [35434956/35434956]


Checking for TinyYOLOV4 data files...
--2021-12-11 01:11:13--  https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4-tiny.cfg
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3231 (3.2K) [text/plain]
Saving to: '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg'

/var/lib/zmeventnotification/models/tinyyolo 100%[=============================================================================================>]   3.16K  --.-KB/s    in 0.03s

2021-12-11 01:11:14 (107 KB/s) - '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg' saved [3231/3231]

--2021-12-11 01:11:14--  https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 625 [text/plain]
Saving to: '/var/lib/zmeventnotification/models/tinyyolov4/coco.names'

/var/lib/zmeventnotification/models/tinyyolo 100%[=============================================================================================>]     625  --.-KB/s    in 0s

2021-12-11 01:11:14 (49.3 MB/s) - '/var/lib/zmeventnotification/models/tinyyolov4/coco.names' saved [625/625]

--2021-12-11 01:11:14--  https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights
Resolving github.com (github.com)... 20.201.28.151
Connecting to github.com (github.com)|20.201.28.151|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/75388965/228a9c00-3ea4-11eb-8e80-28d71569f56c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211211T041114Z&X-Amz-Expires=300&X-Amz-Signature=61c2aaec03a0b352f38621e707f9b473308302e13af628d979eab5795dc34825&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=75388965&response-content-disposition=attachment%3B%20filename%3Dyolov4-tiny.weights&response-content-type=application%2Foctet-stream [following]
--2021-12-11 01:11:14--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/75388965/228a9c00-3ea4-11eb-8e80-28d71569f56c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211211T041114Z&X-Amz-Expires=300&X-Amz-Signature=61c2aaec03a0b352f38621e707f9b473308302e13af628d979eab5795dc34825&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=75388965&response-content-disposition=attachment%3B%20filename%3Dyolov4-tiny.weights&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24251276 (23M) [application/octet-stream]
Saving to: '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights'

/var/lib/zmeventnotification/models/tinyyolo 100%[=============================================================================================>]  23.13M  2.33MB/s    in 11s

2021-12-11 01:11:27 (2.03 MB/s) - '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights' saved [24251276/24251276]


Checking for YOLOV4 data files...
WARNING:Note, you need OpenCV 4.4+ for Yolov4 to work
--2021-12-11 01:11:27--  https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4.cfg
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12231 (12K) [text/plain]
Saving to: '/var/lib/zmeventnotification/models/yolov4/yolov4.cfg'

/var/lib/zmeventnotification/models/yolov4/y 100%[=============================================================================================>]  11.94K  --.-KB/s    in 0.001s

2021-12-11 01:11:27 (12.1 MB/s) - '/var/lib/zmeventnotification/models/yolov4/yolov4.cfg' saved [12231/12231]

--2021-12-11 01:11:27--  https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 625 [text/plain]
Saving to: '/var/lib/zmeventnotification/models/yolov4/coco.names'

/var/lib/zmeventnotification/models/yolov4/c 100%[=============================================================================================>]     625  --.-KB/s    in 0s

2021-12-11 01:11:27 (55.7 MB/s) - '/var/lib/zmeventnotification/models/yolov4/coco.names' saved [625/625]

--2021-12-11 01:11:27--  https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
Resolving github.com (github.com)... 20.201.28.151
Connecting to github.com (github.com)|20.201.28.151|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/75388965/ba4b6380-889c-11ea-9751-f994f5961796?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211211T041128Z&X-Amz-Expires=300&X-Amz-Signature=f5d34a25d4150028895ffafe4a8b502a6f07edfca6637d168e7be9ea209d2395&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=75388965&response-content-disposition=attachment%3B%20filename%3Dyolov4.weights&response-content-type=application%2Foctet-stream [following]
--2021-12-11 01:11:28--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/75388965/ba4b6380-889c-11ea-9751-f994f5961796?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211211T041128Z&X-Amz-Expires=300&X-Amz-Signature=f5d34a25d4150028895ffafe4a8b502a6f07edfca6637d168e7be9ea209d2395&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=75388965&response-content-disposition=attachment%3B%20filename%3Dyolov4.weights&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 257717640 (246M) [application/octet-stream]
Saving to: '/var/lib/zmeventnotification/models/yolov4/yolov4.weights'

/var/lib/zmeventnotification/models/yolov4/y 100%[=============================================================================================>] 245.78M  2.31MB/s    in 2m 23s

2021-12-11 01:13:51 (1.72 MB/s) - '/var/lib/zmeventnotification/models/yolov4/yolov4.weights' saved [257717640/257717640]

*** Installing push api plugins ***
*** Installing detection scripts ***

*** Installing user contributions ***
Copying over contrib/contrib_guidelines.rst...
install: 'contrib/contrib_guidelines.rst' and '/var/lib/zmeventnotification/contrib/contrib_guidelines.rst' are the same file
Copying over contrib/example.py...
install: 'contrib/example.py' and '/var/lib/zmeventnotification/contrib/example.py' are the same file
Copying over contrib/ftp_selective_upload.py...
install: 'contrib/ftp_selective_upload.py' and '/var/lib/zmeventnotification/contrib/ftp_selective_upload.py' are the same file

Removing old version of zmes_hook_helpers, if any
Traceback (most recent call last):
  File "./hook/zm_detect.py", line 13, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
sudo: pip3: command not found
ERROR:python hooks setup failed
Installing package deps...
Installing gifsicle, if needed...
Selecting previously unselected package gifsicle.
(Reading database ... 90248 files and directories currently installed.)
Preparing to unpack .../gifsicle_1.91-2_amd64.deb ...
Unpacking gifsicle (1.91-2) ...
Setting up gifsicle (1.91-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

Could someone help me please, I don't know what is wrong, I'm trying this again and again and always have the same error or worse. I' tryin differents ways to install Python and different versions but nothing change.

Thanks
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by Magic919 »

You are missing numpy. Do pip install numpy.
-
JCAK
Posts: 9
Joined: Mon Dec 20, 2021 2:56 am

Re: ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by JCAK »

Magic919 wrote: Mon Dec 20, 2021 8:58 am You are missing numpy. Do pip install numpy.
This is not the right way, because numpy is not the only missing module, after this line the installation process stop. If i do a manual installation of numpy and run the Hook installation process again it asks me for another module and stop again.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by asker »

Looks like you don't have pip3 - which is used by default to install the packages

sudo apt-get install python3-pip

And then try install again and make sur everything works
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
JCAK
Posts: 9
Joined: Mon Dec 20, 2021 2:56 am

Re: ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by JCAK »

asker wrote: Mon Dec 20, 2021 11:57 am Looks like you don't have pip3 - which is used by default to install the packages

sudo apt-get install python3-pip

And then try install again and make sur everything works
I have "python3-pip" installed in the same way as you suggest.

I tried also with virtual environments, and with python 3.7 and 3.8. Always have the same error.
I already lost count of how many times I installed everything from scratch and in different ways.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by Magic919 »

I have no more ideas.
-
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: ModuleNotFoundError: No module named 'numpy' (zmeventnotification)

Post by asker »

JCAK wrote: Mon Dec 20, 2021 12:44 pm
asker wrote: Mon Dec 20, 2021 11:57 am Looks like you don't have pip3 - which is used by default to install the packages

sudo apt-get install python3-pip

And then try install again and make sur everything works
I have "python3-pip" installed in the same way as you suggest.

I tried also with virtual environments, and with python 3.7 and 3.8. Always have the same error.
I already lost count of how many times I installed everything from scratch and in different ways.
The message specifically says pip3 not found which means install can't find it. Most often this points to missing paths/installs for a specific user (i.e. root or www-data can't find those installs, but your user login can)

Try these commands:
pp@homeserver:~$ which pip3
/usr/bin/pip3
pp@homeserver:~$ sudo -u root which pip3
[sudo] password for pp:
/usr/bin/pip3
pp@homeserver:~$
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Post Reply