Installing custom compiled OpenCV with PyCharm

Viewed 13

I have been trying to install a installation of OpenCV I compiled myself into PyCharm. I followed a basic tutorial, making the CMake and Visual Studio files, then building it and installing it on the system. On the system-wide-installation, it works perfectly in system terminal

However, when using the PyCharm interpreter, I can't get the package to work. When I try adding it adding the folder build/python_loader, I just get the error

ImportError: DLL load failed while importing cv2

I'm guessing the binaries somehow aren't added, especially as it works when using the system-wide interpreter. Having really no experience with CMake and cpp files, I have no idea where to put anything for it to work.
Any ideas?

1 Answers

Allright so I solved it myself.

Apparently inside the cv2 folder you have config files, which you have to point to the install folder. I had copied the path directly, so it used "" for file locations, and the program thought I was trying to escape the string. Changed to "/" and it works seamlesly.

Related