opencv was not found in the pkg-config

Using cmake and cuda i create opencv , the file was saved in

/usr/local/lib/python3.8/dist-packages/cv2/python-3.8/cv2.so

now i'm trying to install darknet but i got this error

Package opencv was not found in the pkg-config search path.

Perhaps you should add the directory containing opencv.pcto the PKG_CONFIG_PATH environment variable

No package 'opencv' found

1 Answer

Because, you installed it manually from source. It should declared .pc file in one of the directories or through environment variable.

man pkg-config

pkg-config retrieves information about packages from special metadata files. These files are named after the package, and has a .pc exten‐ sion. On most systems, pkg-config looks in /usr/lib/pkgconfig, /usr/share/pkgconfig, /usr/local/lib/pkgconfig and /usr/lo‐ cal/share/pkgconfig for these files. It will additionally look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.

Just make sure you have installed opencv not just copied its shared lib to python. I expect default installation put .pc file in /usr/local/lib/pkgconfig/

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like