1

I managed to successfully build and install OpenCV 3.1.0 on my laptop. However, on my desktop, any attempt to import a opencv_contrib module into Python fails with the message "cannot import name ...". The DLLs have been generated and the Dependency Walker has no problem finding them (there was an issue with DLL location when I was doing the installation on my laptop).

The setup on the two machines appears to be the same. But I'm not too sure about that as I don't really know where the problem might be. Both machines use Windows 7 and Python 2.7. The only difference during the build process was that on the desktop I was building OpenCV with CUDA enabled.

Please help.

shad0w_wa1k3r
  • 12,955
  • 8
  • 67
  • 90
n.jmurov
  • 123
  • 2
  • 12

1 Answers1

0

For Python 3.6/3.5 you could use *.whl (Python on Wheels) module from here:

pip install opencv_python-3.2.0+contrib-cp36-cp36m-win_amd64.whl

For Python 2.7 there is no opencv+contrib in one module, but you could separately install opencv module without contrib from here at the end of the page and then add opencv-contrib-python module:

pip install opencv_python-3.2.0.7-cp27-cp27m-win_amd64.whl
pip install opencv-contrib-python

Do not mix opencv+contrib opencv-python (3.2.0+contrib) and opencv-contrib-python (3.2.0.7) modules, otherwise your "import cv2" stop to work till you delete opencv-contrib-python module.

FooBar167
  • 2,721
  • 1
  • 26
  • 37