build opencv for windows
Hey I am trying to build OpenCV 4.0 for Windows 10 with Python bindings and then use them with my anaconda environment. Unfortunately after I build everything and then try to do a "pip install (path to install folder)\python" it seems like it installed correctly but I get a recursion error similar to the recursion post I've provided below. I have also attempted to just copy the pyd and DLLs as suggested but I get an import error DLL couldn't be found. I have even tried to building with SHARED LIBS off and then copying and pasting that with and without DLLs and I still get the DLL couldn't be found error. Has anyone got this successfully built for windows 10 and an Anaconda env running python 3.7.1? if So can you help me figure it out.
link to a post with static lib build
EDIT:
I came across this post https://github.com/skvark/opencv-python/issues/36 and decided to give some of it a try and dumpbin.exe may have shed some more light on my situation when it comes to copy and pasting. I rebuilt my 4.0 source and used static libraries this time. I am also missing several of these dlls in my anaconda paths. I guess I need to manually grab some of these like the libgst*.dll DLLs. I'm not to sure if I need to grab what appear to be system dlls though. However since I am building static libraries now I think I only need to worry about the external DLLs.
dumpbin.exe C:\OpenCV\build\opencv-4.0.0\install\python\cv2\python-3.7\cv2.cp37-win_amd64.pyd /IMPORTS | findstr dll python37.dll libgstpbutils-1.0-0.dll libgstreamer-1.0-0.dll libgstriff-1.0-0.dll libglib-2.0-0.dll libgstapp-1.0-0.dll libgobject-2.0-0.dll GDI32.dll ole32.dll KERNEL32.dll USER32.dll OLEAUT32.dll COMDLG32.dll ADVAPI32.dll MF.dll MFReadWrite.dll d3d11.dll api-ms-win-downlevel-shlwapi-l1-1-0.dll
import DLL error, can you run an exe (c++ sample compiled)? .
I haven't tried yet I will give it a whirl tomorrow.
You can use dependency walker with file cv2.pyd : open cv2.pyd and wait (may be 5 minutes...) and it will give you missing dll
yeah it looks like its not seeing my gstreamer DLLs: these are the ones its missing
I added these into the anaconda environment and loaded the cv2.pyd with dependency walker and now im not seeing anything missing. However I am still getting the import error.
can you run an opencv sample in opencv bin I think you can find opencv_waldboost_detector.exe
I don't see opencv_waldboost_detector.exe but I do have variouse opencv_test_*.exe files where * is different names. So far they seem to be running with no issue.
So I moved some DLLs around and it looks like the Gstreamer DLLs are now being found. It looks like I'm having an issue with the API-MS-WIN-.DLL, EXT-MS-WIN-.DLL, and one IESHIMS.DLL libraries.
" API-MS-WIN-.DLL, EXT-MS-WIN-.DLL, and one IESHIMS.DLL libraries." that's not a problem. Can you run opencv_waldboost_detector.exe?
I don't have opencv_waldboost_detector.exe is it something I have to choose to build?
in build directory search exe file. If you don't find an exe file you must rebuild with build_samples ON