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

Hi,

I am newbie Go developer and I am trying to test your project but when I try to execute:

go run hellocv.go

I receive the following message:

exec: "pkg-config": executable file not found in $PATH

How to fix it?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 23 (1 by maintainers)

Most upvoted comments

try: sudo apt-get install libopencv-dev it worked for me

https://prateekvjoshi.com/2013/10/18/package-opencv-not-found-lets-find-it/

sudo make install export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

this can fix your problem.

The build instructions for opencv give the answer:

  1. To install libraries, execute the following command from build directory sudo make install

Perhaps others stopped at step 7 like I did.

Im getting this same error but on OS X El Capitan

try: sudo apt-get install libopencv-dev it worked for me

Worked for me as well 😃

that would install a difference version?

I have found: opencv.pc here:

apt-file search opencv.pc
libopencv-dev: /usr/lib/arm-linux-gnueabi/pkgconfig/opencv.pc

How to add the directory into PKG_CONFIG_PATH?

Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable

I have tried to export but I failed:

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib/arm-linux-gnueabi/pkgconfig

The message continues.

try sudo apt-get install libopencv-dev

I am trying to install opencv3.2.0 using sudo apt-get libopencv python. It runs perfectly but couldnt find opencv in pkg-config or even in python, also am not sure if its specifically installing 3.2.0 version or not. i dont want to install it from source.

try: sudo apt-get install libopencv-dev it worked for me

I tried,and it worked. But the version is wrong. What I installed is opencv3.4.x, but pkg-config --modversion opencv 2.4.9.1 why??

try: sudo apt-get install libopencv-dev it worked for me

it worked for me too! thanks!

sudo apt-get install libopencv-dev

this worked for me too