Pycharm solves the problem of using the opencv library without prompting

Don't talk nonsense
1. Prerequisite: After installing the opencv-python and opencv-contrib-python libraries.
2. Solution:
2.1. Open the python interpreter interface: File-Settings-Project: XXX-python interpreter
insert image description here
Click the drop-down button for interpreter selection and click Show All to open the python interpreter interface.
insert image description here

2.2. Enter the interpreter path interface: After left-clicking to select the corresponding interpreter, click the rightmost button among the five buttons above to enter the interpreter path interface. Click the plus sign in the upper left corner to add the path, and add and download cv2\cv2.pyd
insert image description here
in the corresponding location . The location is generally under ...\Lib\site-packages\cv2\cv2.pyd. The previous path is the interpreter path, depending on which interpreter you want to set.

Guess you like

Origin blog.csdn.net/CKeon/article/details/131084767