[BUG] RuntimeError: module compiled against ABI version 0x1000009 but this version of numpy is 0x2000000
I'm trying to run the docker image
docker run --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --network host --rm -i -t luxonis/depthai:latest python3 /depthai/depthai_demo.py
I get the following error
RuntimeError: module compiled against ABI version 0x1000009 but this version of numpy is 0x2000000
Third party libraries failed to import: numpy.core.multiarray failed to import
Run "python3 install_requirements.py" to install dependencies
Seems like this was seen before: #1185
Have you built the Docker container image on your own, or used the pre-built one?
When building on your own, have you changed the Dockerfile, or changed something inside the Docker image? (I don't have an OAK-D camera connected right now, cannot test on my side)
Prebuilt one
docker run --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --network host --rm -i -t luxonis/depthai:latest python3 /depthai/depthai_demo.py
Hello, I found that they're pulling numpy v2 and opencv requires numpy v1.
Overall, I managed to get the rgb preview by changing the versions of numpy and opencv. This worked for me.
numpy==1.26.4
opencv-python==4.8.0.74
And in install_requirements, there's:
if requireOpenCv:
DEPENDENCIES.append('numpy<3.0')
# 4.5.4.58 package is broken for python 3.9
if sys.version_info[0] == 3 and sys.version_info[1] == 9:
DEPENDENCIES.append('opencv-python!=4.5.4.58')
else:
DEPENDENCIES.append('opencv-python<5.0')
But I wonder if they meant numpy<2.0 instead.
Makes sense, the numpy<2.0, AFAIK there is no numpy 3.0 yet
thanks @JasperTan97