Pycharm | cv2 burst red | opencv-python installation | Requirement already satisfied: opencv-python effective solution

When installing opencv-python, the error is reported as follows:

Requirement already satisfied: opencv-python in d:\anaconda\lib\site-packages (4.5.5.64)

Requirement already satisfied: numpy>=1.13.3 in d:\anaconda\lib\site-packages (from opencv-python) (1.14.3)

  

cv2 marked redcv2 marked red
  

So try to install with pip install opencv-python

  
insert image description hereopencv-python already exists, but still marked red
  

It turns out that it is not installed in the programming environment, the solution is as follows:

1. Find the directory where the opencv installation is located

insert image description here
  

2. Copy the cv2 file

insert image description here
  

3. Find the environment where the project is located

insert image description here
  

4. Copy the cv2 file to the Lib folder where the environment is located

insert image description here
  

5. The problem is solved, cv2 no longer reports an error

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43401024/article/details/124409469