I am new to python and installed opencv by typing: pip install opencv-contrib-python
in the command prompt.
Below I have shown a very simple example of reading in an image and showing it on the screen:
However, I get this error:
When I hover over the imread
method in PyCharm, it says Cannot find reference 'imread' in '__init__.py'
It was showing import and runtime errors when I typed import cv2
and import numpy
in the command prompt.
I tried going back to the previous version of NumPy by typing pip install --force-reinstall numpy=1.19.3
. So, now when I type import cv2
and import numpy
in the command prompt, it shows no error but it says it still can't find a reference to it in PyCharm.
I am using Python 3.9.1 with pip 20.2.3.