Closed claudiuskerth closed 8 months ago
Can you run the following command and provide the output if possible? This should at least verify your opencv-python package is working as intended:
python -c "import cv2; print(cv2.__version__)"
Regarding the RPi, it seems you might be missing some system dependencies - try installing those and see if that helps.
You can also use the opencv-python-headless
and opencv-contrib-python-headless
packages if you don't have a window manager. As a last resort, you can also compile the OpenCV Python module yourself, and pick and choose the specific dependencies. That might be your best option for an embedded application.
Regarding Mac, I'm working on getting some builders running on Github soon, so hopefully I can track down the issues on that end of things. I did something recently for another project without any issues, however unlike that project, DVR-Scan also uses opencv-contrib-python
which carries several additional dependencies. Also note that this package has to be kept in sync with the version of opencv-python
you are using. I did not see it in the list above.
Hopefully this helps you get on track, keep me posted and I'll do my best to help out.
Edit: The opencv-python module page covers deprecated OSX versions at the bottom: https://pypi.org/project/opencv-python/
It says OpenCV 4.7 and above require OSX 11. You may want to try installing an older version on OSX if you can't update to 11.
Hi Brandon,
thank you so much for your quick response and sorry, I think the issue is entirely with the opencv-python package.
On my RPi, I have installed the system dependencies mentioned in the forum thread, in particular libatlas-base-dev
. Now trying to import opencv in python (with opencv-python 4.8.0.76 installed) throws this error message:
Traceback (most recent call last): File "
", line 1, in File "/home/claudius/.local/lib/python3.9/site-packages/cv2/init.py", line 181, in bootstrap() File "/home/claudius/.local/lib/python3.9/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: /home/claudius/.local/lib/python3.9/site-packages/cv2/cv2.abi3.so: undefined symbol: __atomic_store_8
claudius
Hi Brandon,
an my Mac (10.14.6), I was now successful after installing an older version of the opencv-python package:
pip install opencv-contrib-python-headless==4.4.0.46
DVR-scan is currently scanning... I'm excited :-)
claudius
Hi,
an my Raspi 4 I was now successfull as well with the older version of opencv-contrib-python-headerless
and an upgrade of numpy from version 1.19.3 to 1.25.2.
On my Mac I could also install the GUI version of opencv-contrib-python
, so that I can select roi's with the mouse. Nice, so far :-)
Now let's see whether dvr-scan can actually detect all bats emerging from tree roosts...
Thanks again for your help, Brandon!
claudius
Hi @claudiuskerth, just wanted to follow up - is everything working as expected now? Thanks!
Have tried to make the error messaging here more clear in v1.6, thanks for the report.
Hi,
despite many hours of trying I just can't seem to get a working installation of dvr-scan on MacOS 10.14.6 nor on Raspbian GNU/Linux 11.
pip install --upgrade dvr-scan[opencv]
which ended with
Calling dvr-scan then returns the following error trace:
pip install --upgrade dvr-scan[opencv]
but opencv wouldn't install because it wants its own numpy package, which it seem to try compiling from source, which failed. I triedpip install --prefer-binary opencv-python
instead which succeeded withThen I tried
pip install dvr-scan[opencv]
(i.e. without--upgrade
). This seemed to be successful at first:but calling dvr-scan returned this error message:
Building dvr-scan from source and installing via pip results in the same error after calling dvr-scan.
pip list
returns:Package Version build 0.10.0 click 8.1.6 Cython 3.0.0 dvr-scan 1.5.1 numpy 1.25.2 opencv-python 4.7.0.68 packaging 23.1 pip 23.2.1 platformdirs 3.10.0 pyobjc-core 9.2 pyobjc-framework-Cocoa 9.2 pyproject_hooks 1.0.0 scenedetect 0.6.2 screeninfo 0.8.1 setuptools 58.1.0 tomli 2.0.1 tqdm 4.66.1
It seems that the opencv-python package ist the culprit, but I have no ideas on how to fix this.
Any help greatly apreaciated!
claudius