'Installation issues using pip for OpenCv

I am currently on Linux x86-64 machine. I am trying to install opencv in my virtual environment using pip however the error I keep receiving is

ERROR: Could not find a version that satisfies the requirement numpy==1.19.3 (from versions: 1.19.2+computecanada, 1.21.0+computecanada, 1.21.2+computecanada)

ERROR: No matching distribution found for numpy==1.19.3

I am running python 3.9.6 (64bit) and my current numpy version is 1.21.3. the command I've been using is pip install opencv-python. i've also tried uninstalling other instances of openCV and have tried the other options all with the same error. Does openCV not support numpy 1.21.3? Would anyone be able to point me in the right direction?



Solution 1:[1]

Actually, this error happens if numpy version does not match OpenCV required version. for my case: I used python 3.6. so I solved this error by following:

  1. pip install numpy==1.19.0
  2. pip install opencv-python==3.4.11.45

after installing numpy I search which OpenCV version support this numpy version, I found 3.4.11.45 so I install it by 2 number command and it is working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MEHEDI BIN HAFIZ