pkg-config 中未找到 opencv

pkg-config 中未找到 opencv

使用cmakecudai create opencv,文件保存在

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

现在我正在尝试安装,darknet但出现了这个错误

opencv在搜索路径中未找到包pkg-config

也许你应该将包含以下内容的目录添加opencv.pcPKG_CONFIG_PATH环境变量中

No package 'opencv' found

答案1

因为您是从源代码手动安装的。它应该.pc在其中一个目录中或通过环境变量声明文件。

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.

只需确保您已安装 opencv,而不仅仅是将其共享库复制到 python。我预计默认安装会将.pc文件放入/usr/local/lib/pkgconfig/

相关内容