1. Development environment
os:win11
python:3.11.2
pycharm:2022.3.2 (Professional Edition)
opencv:4.7.0.68
2. Problem description
When writing opencv-related code, I suddenly found that there is no automatic code completion prompt, only a few most basic completion functions.
3. Solutions
Add an interpreter, and the pro-test is effective.
File -> Settings ->
Project: pythonProject->Python Interpreter->Show All->
Python interpreter -> show interpreter path ->
Interpreter Path -> Add ->
select path ->
Note: Find your corresponding project path (pythonProject path in pycharm), find the "cv2" folder in the project path, select it and confirm.
interpreter path ->
After confirming that there is a "User Added" item, click OK.
Python interpreter ->
Click Apply and wait for the loading progress to complete.
Python interpreter ->
Click OK when the loading progress is complete.
Project: pythonProject->Python Interpreter->Settings->
Click "Confirm".
4. Test
Write a code test and find that the familiar code completion prompt is back.
Note: The newly created project needs to repeat the above operation!