I have installed OpenCv on my Raspberry pi Model 3B.
It is working for python 2.7 but not for python 3
The error im getting is:
pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import cv2
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/.local/lib/python3.7/site-packages/cv2/init.py", line 3, in < module>
from .cv2 import *
ImportError: /home/pi/.local/lib/python3.7/site-packages/cv2/cv2.cpython-37m-arm-l inux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8
EDIT :
I tried using cmake: according to https://answers.opencv.org/question/215735/make-error-__atomic_fetch_add_8-on-raspberrypi4/
I am getting the followin error:
pi@raspberrypi:~ $ cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=${HOME}/opencv_contrib-${OPENCV_VERSION}/m odules \
-D ENABLE_VFPV3=ON \
-D ENABLE_NEON=ON \
-D BUILD_TESTS=OFF \
-D WITH_TBB=OFF
CMake Warning:
No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.
CMake Error: The source directory "/home/pi" does not appear to contain C MakeLists.txt.
EDIT :
installed opencv-python=4.1.0.25 and it worked using pip install opencv-python=4.1.0.25