Home > Blockchain >  OpenCV won't install to python
OpenCV won't install to python

Time:12-31

I am trying to install OpenCV 4.5.5 with CUDA support. I installed the source from their GitHub and the additional OpenCV contrib and built it with CMAKE. I checked BUILD_opencv_python3 when it was done configuring and generating it showed that it had detected python3 and had installed cv2 in site-packages.

CMAKE says it detects python and installs CV2

But cv2 isn't in the site-packages.

CV2 not included in site-packages

So it doesn't load in python. But it does give an interesting error DLL not loaded

What should I do?

I already tried doing a fresh build with CMAKE but it didn't work.

After building OpenCV it generates a PYD file in the lib folder. I don't know if that is helpful or not.

Thanks

CodePudding user response:

You must have missed a step in the process.

  • "Configure" step in cmake-gui, investigates the environment (various paths, e.g. where python wants packages to go) and prepares information for the build
  • "Generate" step in cmake-gui, generates the actual build files (VS Solution)
  • open the .sln in Visual Studio
  • build the ALL_BUILD target
  • build the INSTALL target, and this installs the files, also the python package
  • Related