When using cv2, the function will not be prompted, and it will be highlighted, as shown in the figure below (uninstalling and reinstalling cv2 has failed many times)
But found that it can be used, so it should be installed successfully (pip install opencv-python installation)
Gao Liang looks too uncomfortable, and there is no prompt yet. I checked the Internet and found the following three methods to solve this problem. I only solved it with the third method.
way1: Restart the IDE
way2: Uninstall and reinstall
Seeing someone uninstall and reinstall cv2 will solve the problem
There is also a saying that there are multiple cv2 packages on the computer. After uninstalling, find the location where the environment package is created and delete the redundant cv2 package. Path: Anaconda\envs \Created environment name\Lib\site-packages
way3: Copy the cv2.pyd under the cv2 file to the site-packages folder of the parent directory
My path is D:\ProgramData\Anaconda3\Lib\site-packages\cv2
Copy the cv2.pyd file in this folder to the upper directory
Looking back, I found that the problem was solved aiai