关于这个有很多教程和问题。
This似乎回答了你的问题。编辑:复制如下:1) Download OpenCV from http://opencv.org/downloads.html and extract
2)From the extracted folder, copy the file from the extracted directory:
opencv/build/python/2.7/(either x86 or x64, depending on your Anaconda
version)/cv2.pyd to your Anaconda site-packages directory, e.g.,
C:\Anaconda\Lib\site-packages
3)To get ffmpeg within opencv to work, you'll have to add the directory
that ffmpeg is located in to the path (e.g., opencv/sources/3rdparty
/ffmpeg). Then you'll have to find the dll in that folder (e.g.,
opencv_ffmpeg_64.dll) and copy or rename it to a filename that includes
the opencv version you are installing, (e.g., opencv_ffmpeg249_64) for
2.4.9.
{结束复制}
EDIT2:OpenCV不支持Python 3.x,除了opencv3.0版(仍处于测试阶段)。从下载站点下载3.0版本并尝试(感谢this question)。
祝你好运!