OpenCV : libopencv_core.so.2.4: cannot open shared object file: No such file or directory
just open file called /etc/ld.so.conf.d/opencv.conf
, then insert
/usr/local/opencv/
then type: sudo ldconfig
libopencv_gpu.so.2.4: cannot open shared object file: No such file or directory
I found the problem, it is what i have been expected:
I add in the source file:cv::gpu::printShortCudaDeviceInfo(cv::gpu::getDevice());
And it returned:
OpenCV Error: No GPU support (The library is compiled without CUDA support) in getDevice, file /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp, line 182
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp:182: error: (-216) The library is compiled without CUDA support in function getDevice
Now I have to compile opencv with cuda (CMAKE). But i have ever done this part...
Impossible to install OpenCV Ubuntu (libopencv_core error)
I finally managed to solve my problems. Since this may interested other people, here how I proceed.
I removed entirely opencv from my computer:
sudo make unistall
in the repository where I wrotesudo make install
sudo find / -name "*opencv*" -exec rm -i {} \;
to remove all files containing "opencv"sudo find / -name "*cv2.so*" -exec rm -i {} \;
to remove all files containing "cv2.so"conda uninstall opencv
(if needed)
I followed this link to install OpenCV2.4.10 for Python2.7: I did only the points 5,6,7 and 12 (the remaining ones are useless for what I wanted). I changed a bit the
cmake
command and I typedcmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_OPENGL=ON -D WITH_VTK=ON -D WITH_GTK=ON ..
Now if when typing
import cv2
in Python you get an error like "No module named cv2", edit your.bashrc
file with the following commandexport PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
You will have to reload the .bashrc file (source .bahsrc
) to apply the change.
- Finally I rebooted my computer. And it worked!
To conclude, I don't know why it did not work previously but it appears that with this version of OpenCV I did not encounter any problem!
Good luck!
Can't find libopecv_core.so.2.3, file actually not there
If you really can not find the shared library, it seems to me that you have not installed openCV properly. You might have downloaded openCV but not built the libraries, I assume?
Since you are using Ubuntu you can install openCV from the Ubuntu repositorysudo apt-get install libopencv-dev python-opencv
Related Topics
Connected Components in Opencv
Std::Vector and Contiguous Memory of Multidimensional Arrays
How to Hash and Compare a Pointer-To-Member-Function
Is Std::Vector Copying the Objects with a Push_Back
How to Make an Expandable/Collapsable Section Widget in Qt
How to Get Screenshot of a Window as Bitmap Object in C++
Does a C++ Struct Have a Default Constructor
How to Escape a String for Use in Boost Regex
Reading a Line from Ifstream into a String Variable
Does a Declaration Using "Auto" Match an Extern Declaration That Uses a Concrete Type Specifier
How Non-Member Functions Improve Encapsulation
How to Use a Mask to Iterate Files in a Directory with Boost