It imports the cv2 package when I write the command in python shell. But to check my installation I’m following the JetsonHacksNano repository: https://github.com/JetsonHacksNano/buildOpenCV/tree/master/Examples. I ran the gstreamer_view.cpp to check the installation.
This is weird. Seems the list of libs is truncated. You may try to reinstall opencv4.5. Be sure you’ve configured the build with -D OPENCV_GENERATE_PKGCONFIG=ON.
@MtHiker I’m facing one strange issue. When I run sudo apt-get purge libopencv* to remove previously installed opencv files. It shows nothing is upgraded/no changes made. I ran dpkg -l | grep opencv to check opencv versions on my nano, it returns nothing. But when I run import cv2 on my python shell, it does import cv2.
If you’ve manually installed Opencv-4.5 (sudo make install after building opencv), then apt has no knowledge of your version installed in python, so you would have to remove yourself.
Opencv in python is installed as a library, and you can check this lib dependencies with ldd
These should be overwritten next time you install opencv if having built with python support.
In case you want to be sure about any opencv library on your system, you can try:
# Install locate tool that builds a database of your filesystems
sudo apt update
sudo apt install locate
# Build initial DB excluding tmpfs filesystems. This may take a few minutes on first time
updatedb --prunefs='tmpfs'
# Now find any file libopencv_* on your system and provide a list of unique directories:
locate libopencv_ | awk 'BEGIN{FS=OFS="/"}{NF--; print}' | sort -u
command, I saw my libopencv* files are under two folders /usr/local/lib and /home/xxx/lib. If I remove all libopencv* files from this two folder, will my previous opencv files be deleted?
Moreover, does having older opencv files in my system effect my new installation? or it overwrites the previous files on its way to the installation?
Hello @Honey_Patouceul, I attached my output from both ldd input. Both them got libopencv* extensions. Could you please tell how can I distinguish them?