Hello there,
I am a Ubuntu 16.04 user. I started the system first with OpenCV (2.4.0) and then started the yolo setup with OpenCV support. When I finish the process, I get an error about the following library when I write ./darknet. How can I solve my problem?
./darknet
./darknet: error while loading shared libraries: libopencv_highgui.so.3.4: cannot open shared object file: No such file or directory
./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg
./darknet: error while loading shared libraries: libopencv_highgui.so.3.4: cannot open shared object file: No such file or directory
Had the same issue as you on 17.10. After running both below, I was able to run darknet:
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'sudo ldconfigThank you,
The sudo ldconfig command solved my problem.
having this error , please help
./darknet: error while loading shared libraries: libopencv_highgui.so.3.1: cannot open shared object file: No such file or directory
@rachana88 you shall do the same as @guerillagorilla 's solution but replace the /usr/local/lib with the actual location of where you have installed the opencv
I have the same problem. I have 4.0 version in /usr/local/lib : libopencv_highgui.so.4.0 but the error is about libopencv_highgui.so.3.3. So even after trying your solution it doesn't work because there isn't the libopencv_highgui.so.3.3 there's only libopencv_highgui.so.4.0.
I too had this issue but was able to re-install withapt-get install libopencv-highgui-dev
I have the same problem. I have 4.0 version in /usr/local/lib : libopencv_highgui.so.4.0 but the error is about libopencv_highgui.so.3.3. So even after trying your solution it doesn't work because there isn't the libopencv_highgui.so.3.3 there's only libopencv_highgui.so.4.0.
@mouradbelo
How did you fix the problem in the end? I have the same issue and I don't know how to install the older version of that library. Please help!
@LinderPi
I think you need to update your pkgconfig path file and compile again darknet. I don't have my computer in front of me now, i'll tell you how tomorrow. However if you want to install the old OpenCV library here's the link: https://opencv.org/releases.html.
Download the source code of the 3.3 version, compile then install. Here's a link on how to do this : https://docs.opencv.org/3.4/d7/d9f/tutorial_linux_install.html.
You can use ccmake instead of cmake to list all the options and choose what you want.
Hope this helps !
for noobs (me) solution:
Install libs:
sudo apt-get install libopencv-highgui-dev
search for installed file
find /usr | grep libopencv_highgui.so.3.4
For miniconda/annaconda users, the libopencv_highgui.so.3.2 is located in : miniconda/envs/env_namexxx/lib
I am a MacOS 10.14 user and opencv-contrib-python version is 4.1.2.30 , I tried to import Darknet on python in terminal the error message was
OSError: libopencv_highgui.so.3.2: cannot open shared object file: No such file or directory
And @guerillagorilla 's solution doent work for me and I have already changed the path into where my libopencv_highgui.so.3.2 is installed
Can anyone help
I tried to find where libopencv_highgui.so.3.2 is installed so I tried
find /usr | grep libopencv_highgui.so.3.2
Then here's the output
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.3.2
So then I tried
sudo /bin/bash -c 'echo "/usr/lib/x86_64-linux-gnu/" > /etc/ld.so.conf.d/opencv.conf'
(Also I have also tried
sudo /bin/bash -c 'echo "/usr/lib/" > /etc/ld.so.conf.d/opencv.conf')
And
sudo ldconfig
then I got the same error message again
Thanks to your post fixed a similar issue!
My fix was slightly different and am noting here so I don't forget :). Due to using an Azure Deep Learning Virtual Machine on Ubuntu 18.04 the OpenCV library files we're in the anaconda environment directories.
My error: error while loading shared libraries: libopencv_dnn.so.3.4: cannot open shared object file: No such file or directory
Used similar steps to you:
Note to be safe I also deleted the darknet repo folder and rebuilt using CMake as per readme.
Had the same issue as you on 17.10. After running both below, I was able to run darknet:
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'sudo ldconfig
thank you @guerillagorilla you saved my day ~,~
What about this situation?
./darknet: error while loading shared libraries: libmvec.so.1: cannot open shared object file: No such file or directory
I hade OpenCV 4.0 and then I removed it and installed OpenCV 3.4 from the source. After that, I got the same issue. I followed the above instructions but none of them worked except reinstalling darknet. After reinstalling darknet the problem was solved.
Ubuntu 18.04
Jetson TX2
using make clean and then make ,it has solved!
Most helpful comment
Had the same issue as you on 17.10. After running both below, I was able to run darknet:
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'sudo ldconfig