windows: ModuleNotFoundError: No module named 'cv2'

asked 2020-07-10 17:27:24 -0500

updated 2020-07-11 03:33:55 -0500

supra56 gravatar image

I installed opencv (latest from master branch) with the latest cmake. I built it in VS19 and everything went fine. However, when I look for it in the command prompt it gives me the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'

there are my paths, I added these after building in VS.
C:\Python37\python.exe
C:\Python37\include
C:\Python37\Lib
C:\Python37\Lib\site-packages\numpy\core\include
C:\Python37\Lib\site-packages

what went wrong?

edit retag flag offensive close merge delete

Comments

I added these after building in VS

you (may) have to add those to cmake before doing anything else.

please edit your question and add the cmake output (yea, all of it ...)

did you build the INSTALL project ?

also note, that cv2 will only be build in RELEASE mode (no DEBUG python libs there)

berak gravatar imageberak ( 2020-07-11 01:56:10 -0500 )edit

Didn't you try this sudo make install ?

supra56 gravatar imagesupra56 ( 2020-07-11 22:24:50 -0500 )edit