No module named 'cv2' but opencv is installed

asked 2019-12-27 08:28:20 -0600

Marius Gaus gravatar image

Hey Guys, i've installed opencv-python using pip and tried to run a code that uses opencv in Visual Studio Code. I can't run the code, everytime I try to run it, i get this error message:

Traceback (most recent call last): File "c:/Users/Marius/Entwicklung/local_light_absorber/opencv_test.py", line 1, in <module> import cv2 ModuleNotFoundError: No module named 'cv2'

I know there are already questions in this forum dealing with this problem but none of them helped me. Can you please help me so I can run my code?

edit retag flag offensive close merge delete

Comments

try from a cmdline first, not from VS

please also check, if VS came with it's own python

berak gravatar imageberak ( 2019-12-27 08:42:19 -0600 )edit

Try this:

make install
ldconfig
supra56 gravatar imagesupra56 ( 2019-12-27 09:04:24 -0600 )edit
2

(make install doesn't usually do much under Windows)

mvuori gravatar imagemvuori ( 2019-12-27 13:22:21 -0600 )edit