OpenWeedLocator icon indicating copy to clipboard operation
OpenWeedLocator copied to clipboard

numpy version issue between opencv and picamera2

Open geezacoleman opened this issue 8 months ago • 3 comments

Looks like picamera2 wants numpy < 2.x while opencv 4.11 requires numpy >2.x. Good news is that everything seems to work just fine running 1.24.2 (the base installation). Issues arise if you go ahead and install opencv into the owl virtual environment, it causes a clash that breaks picamera2.

It appears as a very not clear value error where video source 0 is not able to be found.

This will be fixed shortly through an updated installation script.

geezacoleman avatar Jul 25 '25 14:07 geezacoleman

Hello, did you manage to get a fix for this issue?

Aharvey19 avatar Aug 03 '25 17:08 Aharvey19

Yes, I realised this appeared because the latest opencv-contrib-python 4.12.x released a couple of weeks ago now requires numpy>2.x. So if you install opencv-contrib-python==4.10.0.84, this will fix it.

My fault for not pinning package versions and learning the hard way...I am updating this in the wireless-display branch.

But if you are having this issue, just run pip install opencv-contrib-python==4.10.0.84 and pip install numpy==1.24.2 within the owl virtual environment. If you have the latest opencv already install pip will complain with the downgrade, but the latest version of opencv does seem to work just fine with numpy 1.24.2.

geezacoleman avatar Aug 04 '25 09:08 geezacoleman

Worked perfectly thanks

Aharvey19 avatar Aug 04 '25 21:08 Aharvey19