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.
If you are using python interpreter with anaconda change it to default python one. if you have not installed python separately then install it and assign the path to it.
somewhat this will be the path
c://user/APpData/Local/Programs/Python/python39/python.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With