0

I'm trying to install the OpenCV library, to be able to manipulate images, to install it, I'm using the command in prompt:

pip install opencv-python

But it doesn't work, in pycharm the methods I need do not appear, such as: "cv2.imread()" or "cv2.imshow()":

Pycharm IDE

Notes:

  • I'm using the python version 3.11.1
  • i'm using the OpenCv version 4.7.0.68
  • I'm coding in Windows plataform

I also tried using the command:

pip install opencv-contrib-python

I thought that would solve the situation, but it stayed the same

2 Answers2

1

in PyCharm open from menue FILE - SETTINGS go to PROJECT:<your_project_name> and select PYTHON INTERPRETER click on the gear symbol next to the interpreter path and select SHOW ALL make sure the correct interpreter is selected click on that icon that looks like a folder tree (on the top) click on the "+" icon select the folder where the opencv package is located normally (if you installed it via package manager) you will find it in: <your_project_path>\venv\Lib\site-packages\cv2 click OK (twice) wait for updating skeletons

Referer: https://stackoverflow.com/a/74411482/11687405

bruce
  • 462
  • 6
  • 9
0

This will fix issue but roll you back to the previous version

pip install opencv-python==4.5.5.62

do this to return back to the latest version

pip install -U opencv-python
Ronin
  • 1,811
  • 1
  • 16
  • 17