At first
, in order to solve this problem, reading countless blogs can only be said to be fruitless. My opencv-python is installed in the virtual environment of anaconda.
I was happy to import cv2, but there is a problem with the cv2 code prompt below. There is no code prompt? ! This is just the beginning, so you can't rely on muscle memory to type code T_TAt the beginning, I honestly tried the methods of other bloggers one by one. At first, I thought it was a problem with the opencv version, and later I modified the numpy version to no avail.
Later I usedimport cv2.cv2 as cv
code similar to this, also didn't solve the problem
Now let me talk about the solution to my situation. Under the guidance of my classmates, I found cv2.pyd'
the file in the folder cv2 in anaconda
and moved it to the upper level site-packages
folder.
Then pycharm can realize the intelligent perception
. Finally, Hope this article can help you! ! !