Solve the problem that the cv2 library function prompt does not appear when using opencv in the Anaconda virtual environment in Pycharm:

Problem Description:

Solve the problem that when using opencv in the Anaconda virtual environment in Pycharm, the cv2 library function prompt will not appear and highlighting will occur in Pycharm:

With the attitude of being able to solve the problem, I searched for many solutions on the Internet. The simplest and crudest way is to directly uninstall the existing opencv and re-enter it in the Pycharm terminal:

pip install opencv-pthon

The installation is OK. This is a very high probability that the problem of no prompt can be solved, but after restarting pycharm many times, I found that the prompt cannot be performed again. . . . . .

So after searching, I found a new way to solve the problem by configuring the python interpreter of the virtual environment used. The steps are as follows:

 

Just click "Confirm". After waiting for Pycharm to rescan and update the python interpreter settings, you can find that the cv2 prompt message pops up successfully when you use it again. Personal testing is available!

 

Guess you like

Origin blog.csdn.net/qq_58611650/article/details/132577885