Skip to content

Issue installing hooks on Ubuntu 24.04 Python 3.12 #440

@TomStageDK

Description

@TomStageDK

OS

Ubuntu 24.04 LTS
Linux REDACTED 6.8.0-62-generic #65-Ubuntu SMP PREEMPT_DYNAMIC Mon May 19 17:15:03 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Python Version

Python 3.12.3

Event Server version

6.1.26

Hooks version (if you are using Object Detection)

app:6.1.26

Are you using MLAPI? (Y/N)
N

The version of ZoneMinder you are using:
v1.36.35

What is the nature of your issue

Bug

Details
Removing old version of zmes_hook_helpers, if any
Traceback (most recent call last):
File "/opt/zmeventnotification/./hook/zm_detect.py", line 27, in
import zmes_hook_helpers.utils as utils
File "/opt/zmeventnotification/hook/zmes_hook_helpers/utils.py", line 21, in
from future import standard_library
File "/usr/lib/python3/dist-packages/future/standard_library/init.py", line 65, in
import imp
ModuleNotFoundError: No module named 'imp'
Using pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
Processing ./hook
Running command python setup.py egg_info
/usr/lib/python3/dist-packages/setuptools/dist.py:509: SetuptoolsDeprecationWarning: Invalid version: ''.
!!

      ********************************************************************************
      The version specified is not a valid version according to PEP 440.
      This may not work as expected with newer versions of
      setuptools, pip, and PyPI.

      This deprecation is overdue, please update your project and remove deprecated
      calls to avoid build errors in the future.

      See https://peps.python.org/pep-0440/ for details.
      ********************************************************************************

!!
self._validate_version(self.metadata.version)
VERBOSE: Reading /opt/zmeventnotification/hook/zmes_hook_helpers/init.py
VERBOSE: version_file is version = ""
VERSION=version

running egg_info
creating /tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info
writing /tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/dependency_links.txt
writing requirements to /tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/SOURCES.txt'
reading manifest file '/tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file '/tmp/pip-pip-egg-info-kfobzaap/zmes_hook_helpers.egg-info/SOURCES.txt'
Preparing metadata (setup.py) ... done
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (from zmes-hook-helpers==0.0.0) (10.2.0)
Requirement already satisfied: Shapely in /usr/lib/python3/dist-packages (from zmes-hook-helpers==0.0.0) (2.0.3)
Requirement already satisfied: configupdater in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (3.2)
Requirement already satisfied: future in /usr/lib/python3/dist-packages (from zmes-hook-helpers==0.0.0) (0.18.2)
Requirement already satisfied: imageio in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (2.37.0)
Requirement already satisfied: imageio-ffmpeg in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (0.6.0)
Requirement already satisfied: imutils in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (0.5.4)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from zmes-hook-helpers==0.0.0) (1.26.4)
Requirement already satisfied: pygifsicle in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (1.1.0)
Requirement already satisfied: pyzm>=0.3.56 in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (0.3.64)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from zmes-hook-helpers==0.0.0) (2.31.0)
Requirement already satisfied: scikit-learn in /usr/local/lib/python3.12/dist-packages (from zmes-hook-helpers==0.0.0) (1.7.0)
Requirement already satisfied: SQLAlchemy<1.4.0,>=1.3.20 in /usr/local/lib/python3.12/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (1.3.24)
Requirement already satisfied: mysql-connector-python>=8.0.16 in /usr/local/lib/python3.12/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (9.3.0)
Requirement already satisfied: dateparser>=1.0.0 in /usr/lib/python3/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (1.2.0)
Requirement already satisfied: websocket-client>=0.57.0 in /usr/lib/python3/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (1.7.0)
Requirement already satisfied: progressbar2>=3.53.1 in /usr/local/lib/python3.12/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (4.5.0)
Requirement already satisfied: portalocker>=2.3.0 in /usr/local/lib/python3.12/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (3.2.0)
Requirement already satisfied: psutil>=5.7.3 in /usr/lib/python3/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (5.9.8)
Requirement already satisfied: python-dotenv in /usr/lib/python3/dist-packages (from pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (1.0.1)
Requirement already satisfied: scipy>=1.8.0 in /usr/local/lib/python3.12/dist-packages (from scikit-learn->zmes-hook-helpers==0.0.0) (1.16.0)
Requirement already satisfied: joblib>=1.2.0 in /usr/local/lib/python3.12/dist-packages (from scikit-learn->zmes-hook-helpers==0.0.0) (1.5.1)
Requirement already satisfied: threadpoolctl>=3.1.0 in /usr/local/lib/python3.12/dist-packages (from scikit-learn->zmes-hook-helpers==0.0.0) (3.6.0)
Requirement already satisfied: python-utils>=3.8.1 in /usr/local/lib/python3.12/dist-packages (from progressbar2>=3.53.1->pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (3.9.1)
Requirement already satisfied: typing_extensions>3.10.0.2 in /usr/local/lib/python3.12/dist-packages (from python-utils>=3.8.1->progressbar2>=3.53.1->pyzm>=0.3.56->zmes-hook-helpers==0.0.0) (4.14.0)
Building wheels for collected packages: zmes-hook-helpers
Running command python setup.py bdist_wheel
VERBOSE: Reading /opt/zmeventnotification/hook/zmes_hook_helpers/init.py
VERBOSE: version_file is version = ""
VERSION=version

/usr/lib/python3/dist-packages/setuptools/dist.py:509: SetuptoolsDeprecationWarning: Invalid version: ''.
!!

      ********************************************************************************
      The version specified is not a valid version according to PEP 440.
      This may not work as expected with newer versions of
      setuptools, pip, and PyPI.

      This deprecation is overdue, please update your project and remove deprecated
      calls to avoid build errors in the future.

      See https://peps.python.org/pep-0440/ for details.
      ********************************************************************************

!!
self._validate_version(self.metadata.version)
running bdist_wheel
running build
running build_py
copying zmes_hook_helpers/init.py -> build/lib/zmes_hook_helpers
/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

      ********************************************************************************
      Please avoid running ``setup.py`` directly.
      Instead, use pypa/build, pypa/installer or other
      standards-based tools.

      See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
      ********************************************************************************

!!
self.initialize_options()
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/zmes_hook_helpers
copying build/lib/zmes_hook_helpers/image_manip.py -> build/bdist.linux-x86_64/wheel/zmes_hook_helpers
copying build/lib/zmes_hook_helpers/apigw.py -> build/bdist.linux-x86_64/wheel/zmes_hook_helpers
copying build/lib/zmes_hook_helpers/init.py -> build/bdist.linux-x86_64/wheel/zmes_hook_helpers
copying build/lib/zmes_hook_helpers/common_params.py -> build/bdist.linux-x86_64/wheel/zmes_hook_helpers
copying build/lib/zmes_hook_helpers/log.py -> build/bdist.linux-x86_64/wheel/zmes_hook_helpers
copying build/lib/zmes_hook_helpers/utils.py -> build/bdist.linux-x86_64/wheel/zmes_hook_helpers
running install_egg_info
running egg_info
writing zmes_hook_helpers.egg-info/PKG-INFO
writing dependency_links to zmes_hook_helpers.egg-info/dependency_links.txt
writing requirements to zmes_hook_helpers.egg-info/requires.txt
writing top-level names to zmes_hook_helpers.egg-info/top_level.txt
reading manifest file 'zmes_hook_helpers.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'zmes_hook_helpers.egg-info/SOURCES.txt'
Copying zmes_hook_helpers.egg-info to build/bdist.linux-x86_64/wheel/zmes_hook_helpers-0.0.0.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/zmes_hook_helpers-0.0.0.dist-info/WHEEL
creating '/tmp/pip-wheel-vlq5mine/zmes_hook_helpers-0.0.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'zmes_hook_helpers/init.py'
adding 'zmes_hook_helpers/apigw.py'
adding 'zmes_hook_helpers/common_params.py'
adding 'zmes_hook_helpers/image_manip.py'
adding 'zmes_hook_helpers/log.py'
adding 'zmes_hook_helpers/utils.py'
adding 'zmes_hook_helpers-0.0.0.dist-info/LICENSE'
adding 'zmes_hook_helpers-0.0.0.dist-info/METADATA'
adding 'zmes_hook_helpers-0.0.0.dist-info/WHEEL'
adding 'zmes_hook_helpers-0.0.0.dist-info/top_level.txt'
adding 'zmes_hook_helpers-0.0.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Building wheel for zmes-hook-helpers (setup.py) ... done
Created wheel for zmes-hook-helpers: filename=zmes_hook_helpers-0.0.0-py3-none-any.whl size=13015 sha256=722ee303e99cd733d4160823c4f79b7f5b6fb7f80c46c9a33337537971349b20
Stored in directory: /tmp/pip-ephem-wheel-cache-b3kv7505/wheels/4d/42/da/e7b4bac65590c098b92fdcc307a63351e7bcd04075993ba59b
Successfully built zmes-hook-helpers
Installing collected packages: zmes-hook-helpers
Attempting uninstall: zmes-hook-helpers
Found existing installation: zmes-hook-helpers 0.0.0
Uninstalling zmes-hook-helpers-0.0.0:
Removing file or directory /usr/local/lib/python3.12/dist-packages/zmes_hook_helpers-0.0.0.dist-info/
Removing file or directory /usr/local/lib/python3.12/dist-packages/zmes_hook_helpers/
Successfully uninstalled zmes-hook-helpers-0.0.0
Successfully installed zmes-hook-helpers-0.0.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Success:Done

|-------------------------- NOTE -------------------------------------|

 Hooks are installed, but please make sure you have the right version
 of OpenCV installed. I recommend removing any pip packages you may
 have installed of opencv* and compiling OpenCV 4.4.x+ from source.
 See https://zmeventnotification.readthedocs.io/en/latest/guides/hooks.html#opencv-install

|----------------------------------------------------------------------|

For the ModuleNotFoundError: No module named 'imp'
A quick search on the internet let me to this post:
https://discuss.python.org/t/how-do-i-migrate-from-imp/27885/9

And in that post let me to this documentation:
https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly

The "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv" could be suppressed by adding the "--root-user-action=ignore" to the command after the "install".

Python Module versions with Ubuntu 24.04 LTS that should satisfy some of the requirements:
python3-sqlalchemy = 1.4.50
python3-requests = 2.31.0
python3-dateparser = 1.2.0
python3-websocket = 1.7.0
python3-shapely = 2.0.3
python3-numpy = 1:1.26.4
python3-psutil = 5.9.8
python3-dotenv = 1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions