zmevnetnotification w/hooks python OpenCV permissions issue

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
vtdstein95
Posts: 31
Joined: Sun Jan 24, 2016 3:13 pm

zmevnetnotification w/hooks python OpenCV permissions issue

Post by vtdstein95 » Tue May 04, 2021 8:31 pm

This is not an issue with zmeventnotification/hooks. I have been experimenting with an Intel Neural Compute Stick 2 https://software.intel.com/content/www/ ... stick.html. My goal is to eventually use the NCS2 for the ML part of hooks.

I have followed all the instructions from Intel to get the NCS2 working and it does. Next I have been following the instructions to get zmeventnotirication installed and working. For the OpenCV install, I used the Intel optimized OpenCV source, compiled and installed as I expected that would be the easiest way to reach my end goal.

Running the test with zm_event_start.sh yields this:

Code: Select all

user@host:/var/lib/zmeventnotification/bin$ sudo -u www-data /var/lib/zmeventnotification/bin/zm_event_start.sh 147921
Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 15, in <module>
    import imutils
  File "/usr/local/lib/python3.8/dist-packages/imutils/__init__.py", line 8, in <module>
    from .convenience import translate
  File "/usr/local/lib/python3.8/dist-packages/imutils/convenience.py", line 6, in <module>
    import cv2
  File "/usr/local/lib/python3.8/dist-packages/cv2/__init__.py", line 102, in <module>
    bootstrap()
  File "/usr/local/lib/python3.8/dist-packages/cv2/__init__.py", line 90, in bootstrap
    import cv2
ImportError: libtbb.so.2: cannot open shared object file: No such file or directory
One issue (there appear to be many) is the www-data user can not "import cv2".

As my user:

Code: Select all

Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
4.5.2-openvino
sudo -u www-data python3

Code: Select all

Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/cv2/__init__.py", line 102, in <module>
    bootstrap()
  File "/usr/local/lib/python3.8/dist-packages/cv2/__init__.py", line 90, in bootstrap
    import cv2
ImportError: libtbb.so.2: cannot open shared object file: No such file or directory
I would greatly appreciate it if anybody has any ideas how I might be able to get the www-data user the correct access/permissions.

Thanks in advance.
--
Dave

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests