Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ImportError from cv2.pyd when building with opencv_contrib modules

Hi, I followed this tutorial: http://docs.opencv.org/3.1.0/d5/de5/tutorial_py_setup_in_windows.html

Only difference is that I added the 'opencv_contrib/modules' path for OPENCV_EXTRA_MODULES_PATH.

I'm on Windows 10 x64 but am running 32bit Python. Made sure all my python2 paths were correct. I ran the CMake GUI using 'Visual Studio 14.0 2015', not selecting the 64 version.

It configures and generates fine. I open the OpenCV.sln and build the solution and install using Release and Win32 settings.

It successfully creates a new cv2.pyd in the site-packages directory, however, I get this error trying to import cv2:

ImportError: DLL load failed: The specified module could not be found.

I replaced the cv2.pyd file with the one that comes with the OpenCV 3.1.0 Win install and that works fine, however, I need to use these extra modules, specifically xfeatures2d. I do notice that the .pyd that works is 36,827 KB while the one that is created during the build is only 2,961 KB. Maybe I'm missing something?

Please advise! Thanks ahead.

Using:

  • Python 2.7.6 32-bit
  • CMake 3.7.0
  • Numpy 1.8.1
  • Visual Studio 14.0 2015
  • Windows 10 Pro 64-bit

ImportError from cv2.pyd when building with opencv_contrib modules

Hi, I followed this tutorial: http://docs.opencv.org/3.1.0/d5/de5/tutorial_py_setup_in_windows.html

I used files from the OpenCV git repos, making sure all were at the same version, 3.1.0.

Only difference is that I added the 'opencv_contrib/modules' path for OPENCV_EXTRA_MODULES_PATH.

I'm on Windows 10 x64 but am running 32bit Python. Made sure all my python2 paths were correct. I ran the CMake GUI using 'Visual Studio 14.0 2015', not selecting the 64 version.

It configures and generates fine. I open the OpenCV.sln and build the solution and install using Release and Win32 settings.

It successfully creates a new cv2.pyd in the site-packages directory, however, I get this error trying to import cv2:

ImportError: DLL load failed: The specified module could not be found.

I replaced the cv2.pyd file with the one that comes with the OpenCV 3.1.0 Win install and that works fine, however, I need to use these extra modules, specifically xfeatures2d. I do notice that the .pyd that works is 36,827 KB while the one that is created during the build is only 2,961 KB. Maybe I'm missing something?

Please advise! Thanks ahead.

Using:

  • Python 2.7.6 32-bit
  • CMake 3.7.0
  • Numpy 1.8.1
  • Visual Studio 14.0 2015
  • Windows 10 Pro 64-bit

ImportError from cv2.pyd when building with opencv_contrib modules

Hi, I followed this tutorial: http://docs.opencv.org/3.1.0/d5/de5/tutorial_py_setup_in_windows.html

I used files from the OpenCV git repos, making sure all were at the same version, 3.1.0.

Only difference is that I added the 'opencv_contrib/modules' path for OPENCV_EXTRA_MODULES_PATH.

I'm on Windows 10 x64 but am running 32bit Python. Made sure all my python2 paths were correct. I ran the CMake GUI using 'Visual Studio 14.0 2015', not selecting the 64 version.

It configures and generates fine. I open the OpenCV.sln and build the solution and install using Release and Win32 settings.

It successfully creates a new cv2.pyd in the site-packages directory, however, I get this error trying to import cv2:

ImportError: DLL load failed: The specified module could not be found.

I replaced the cv2.pyd file with the one that comes with the OpenCV 3.1.0 Win install and that works fine, however, I need to use these extra modules, specifically xfeatures2d. I do notice that the .pyd that works is 36,827 KB while the one that is created during the build is only 2,961 KB. Maybe I'm missing something?

Please advise! Thanks ahead.

Using:

  • Python 2.7.6 32-bit
  • CMake 3.7.0
  • Numpy 1.8.1
  • Visual Studio 14.0 2015
  • Windows 10 Pro 64-bit

EDIT: after looking on slackoverflow, I found the answer! I had to copy the .dll files into my site-packages, something that wasn't in the instructions.

ImportError from cv2.pyd when building with opencv_contrib modules

Hi, I followed this tutorial: http://docs.opencv.org/3.1.0/d5/de5/tutorial_py_setup_in_windows.html

I used files from the OpenCV git repos, making sure all were at the same version, 3.1.0.

Only difference is that I added the 'opencv_contrib/modules' path for OPENCV_EXTRA_MODULES_PATH.

I'm on Windows 10 x64 but am running 32bit Python. Made sure all my python2 paths were correct. I ran the CMake GUI using 'Visual Studio 14.0 2015', not selecting the 64 version.

It configures and generates fine. I open the OpenCV.sln and build the solution and install using Release and Win32 settings.

It successfully creates a new cv2.pyd in the site-packages directory, however, I get this error trying to import cv2:

ImportError: DLL load failed: The specified module could not be found.

I replaced the cv2.pyd file with the one that comes with the OpenCV 3.1.0 Win install and that works fine, however, I need to use these extra modules, specifically xfeatures2d. I do notice that the .pyd that works is 36,827 KB while the one that is created during the build is only 2,961 KB. Maybe I'm missing something?

Please advise! Thanks ahead.

Using:

  • Python 2.7.6 32-bit
  • CMake 3.7.0
  • Numpy 1.8.1
  • Visual Studio 14.0 2015
  • Windows 10 Pro 64-bit

**

EDIT: after looking on slackoverflow, I found the answer! I had to copy the .dll files into my site-packages, something that wasn't in the instructions.

**