ImportError: No module named cv2 ImportError: No module named cv2 windows windows

ImportError: No module named cv2


The fastest and cleanest way is to run pip. It's a clean convenient tool for Python packages.

Just run:

pip install opencv-python or C:\Python27\Scripts\pip.exe install opencv-python


The easiest way to install OpenCV on Windows is to simply copy the cv2.pyd file into Python's site-packages directory (e.g. C:\python27\Lib\site-packages).

To get the cv2.pyd file, download and extract the latest version of the OpenCV installation executable from http://sourceforge.net/projects/opencvlibrary/files/opencv-win/ and browse the extracted folder to find the file in the relevant build directory (e.g. build\python\x86\2.7).