import cv2 work on IDLE but error on command prompt

1631 views python

The issue is exactly opposite of this issue.

I have installed OpenCV as mentioned in its documentation on windows 10. (Copying a file into python lib directory).

When I import cv2 from the python IDLE, its working fine but when I use command prompt or Powershell it doesn't work. I'm not using anaconda or Jupiter-notebook or something else as deployment.

What is the issue here..?

enter image description here

answered question

1 Answer


According to your screenshots IDLE is running Python 2.7.13, while in CMD you're on 3.6.4.

These versions have separate lib folders, so you should check whether you installed OpenCV properly on both versions.

Or just stick with Python 2 on CMD.

posted this

Have an answer?


Please login first before posting an answer.