Closed CV8R closed 3 years ago
I had the same issue and tracked it to an error that occurs during the install process of the hooks in the install script:
For me this errors out as follows, so various pre-requisites are not installed:
File "/tmp/pip-req-build-dzqz553y/setup.py", line 44, in <module>
version=find_version('zmes_hook_helpers', '__init__.py'),
File "/tmp/pip-req-build-dzqz553y/setup.py", line 40, in find_version
raise RuntimeError("Unable to find version string.")
RuntimeError: Unable to find version string.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-dzqz553y/
Its not a proper solution really, but the following worked for me by hard coding the version string in the file hook/setup.py
as follows:
sed -i -e 's/version=find_version\(.*\)\,/version='\''6.1.22'\''\,/' hook/setup.py
This ensures the hooks and pre-requisite Python modules get installed, but unfortunately things still don't work right after that when I try to test things out as per the docs, so this might indicate something wrong with my Python3 setup.
For reference I'm running on a Debian 10 based container, so this might be distro based weirdness...
Bingo! Adding the version manually installed the pre-reqs and zm_detect.py executes properly. I am running Ubuntu 20.04.2 LTS on a dedicated server.
Thank you.
@andrewheberle would you grab install.sh and setup.py from master and see if it works? If not, please post the output after you select 'y' for install hook
I am having the same issue. Adding sed -i -e 's/version=find_version(.*)\,/version='\''6.1.22'\''\,/' hook/setup.py causes my install to fail much earlier. I assume I am putting it in the wrong place?
#!/usr/bin/python3
import io
import os
import re
import codecs
from setuptools import setup
sed -i -e 's/version=find_version\(.*\)\,/version='\''6.1.22'\''\,/' hook/setup.py
#Package meta-data
NAME = 'zmes_hook_helpers'
DESCRIPTION = 'ZoneMinder EventServer hook helper functions'
URL = 'https://github.com/pliablepixels/zmeventserver/'
AUTHOR_EMAIL = 'pliablepixels@gmail.com'
AUTHOR = 'Pliable Pixels'
LICENSE = 'GPL'
INSTALL_REQUIRES = [
'numpy', 'requests', 'Shapely', 'imutils',
'pyzm>=0.3.48', 'scikit-learn', 'future', 'imageio',
'imageio-ffmpeg','pygifsicle', 'Pillow'
]
here = os.path.abspath(os.path.dirname(__file__))
# read the contents of your README file
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def read(*parts):
here = os.path.abspath(os.path.dirname(__file__))
print ('VERBOSE: Reading {}'.format(os.path.join(here, *parts)))
with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
print ('VERBOSE: version_file is {}'.format(version_file))
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
setup(name=NAME,
version=find_version('zmes_hook_helpers', '__init__.py'),
description=DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
long_description=long_description,
long_description_content_type='text/markdown',
url=URL,
license=LICENSE,
install_requires=INSTALL_REQUIRES,
py_modules=[
'zmes_hook_helpers.common_params',
'zmes_hook_helpers.log',
'zmes_hook_helpers.image_manip',
'zmes_hook_helpers.apigw',
'zmes_hook_helpers.utils'
])
@pliablepixels i have tested the install with the updated install.sh
and setup.py
and this does fix the hook install issue.
Thanks for that.
Secondly @me8myself ...the sed
command is run from your shell from the location you are running the event server install from...but as I said this is more of a band-aid and not a proper fix (as you can see above this is fixed in the latest code and I'm sure will be included in an updated release).
Sounds good. 6.1.23 was released 3 days ago with this change.
Whenever I try and run the Event Server with hooks enabled I face the error in the title. I have tried re-running the install script (sudo -H ./install.sh) but looks like I am missing dependencies. This was an older 1.32 system with the ES long before the hooks were available. I have been running 1.34.23 for some months and only now trying to experiment with the detections. I was missing a series of dependencies (numpy, pyzm - possibly more cannot recall now) but hung up on this error and cannot get any further.
Event Server version
6.1.22
Hooks version (if you are using Object Detection)
sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --version
returns:
Same result with:
The version of ZoneMinder you are using:
v1.34.23
Debug Logs (if applicable)
Thanks!