How uninstall opencv linux

Uninstalling OpenCV on Ubuntu

Sorry, I read all previous questions, but no solution worked for me. I have downloaded and installed the OpenCv library 3.1.0 (long time ago) Yesterday, I went into samples/python but I could not run: python gabor_threads.py icub.jpg ERROR: cv2.imshow(‘img’, img) If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage Searching for similar error, I understood that I had to remove the current installation of Opencv and build a new one with GUI support. Inside the opencv dir I run:

sudo apt-get purge libopencv* sudo apt autoremove 
sudo pip uninstall opencv 

failed I do not remember how did I install it (with pip, make, …) What can I do now? I guess I have to completely remove OpenCV, but I do not know how to do it. Btw: after openCV I installed keras with conda. Thank you so much. Idil Below is a copy-paste of my opencv dir (I do not have the build dir):

idil@toshiba:~/Downloads/opencv-3.1.0$ ls 3rdparty CTestTestfile.cmake opencv2 apps custom_hal.hpp OpenCVConfig.cmake bin cvconfig.h OpenCVConfig-version.cmake cmake data OpenCVModules.cmake CMakeCache.txt doc platforms CMakeFiles Ele_Read_me.odt README.md cmake_install.cmake include release CMakeLists.txt junk samples cmake_uninstall.cmake lib test-reports CONTRIBUTING.md LICENSE unix-install CPackConfig.cmake Makefile version_string.tmp CPackSourceConfig.cmake modules 

Источник

Shell how to uninstall opencv c ubuntu

Solution 2: I delete all the opencv files, including source file and installed file under /usr/local, finally re-install opencv Solution: This is a file that pkg-config can use to automatically configure the library on a need basis.

How to remove opencv libraries from Ubuntu?

You can remove packages if you installed the package using apt-get, by typing apt-get remove «packagename»(remove quotes).

Additionally you can use whereis command(if memory serves me correctly on ubuntu) by using «whereis packagename» and it should point you to where the conflicting package is, sometimes it is installed within the /usr/bin or the /opt directory , so you can remove that directory manually.

Food for thought if your after a particular file you can use the find command to find the library as well «find packagenameoranyfile»

Читайте также:  Основы системного администрирования linux

Eclipse — How to uninstall opencv in Ubuntu?, The correct way is cd /path/to/cv/build then sudo make uninstall. Of course you will have to have the source code with you. I tried the exec rm thing but nothing changed. Also FYI, sudo apt-get remove libopencv-* …

Uninstall OpenCV 3.0.0 from Ubuntu14.04

You have to use sudo, as the file belongs to the system and you don’t have access to it by default. Try:

I delete all the opencv files, including source file and installed file under /usr/local, finally re-install opencv

How to uninstall OpenCV 2.4.9 completely from Ubuntu?, I had a similar issue, but with version 2.4.8, I found this solution: «So, to find all OpenCV libraries 1. $> sudo find / -name «*opencv*» -exec rm -i <> \; The above command will find any file containing opencv in the name, and will prompt you to remove it. As always, be careful when deleting things manually!

Delete OpenCV 3.1 completly

In the answer below, I make the presumption that you installed version 3.1 from the source or possibly from a PPA. Also note that I have not configured OpenCV to work with Python on my installation.

Removing Old Installation

If you compiled OpenCV version 3.1 via CMake, you should still have the directory you compiled the source in (i.e. your build directory). Navigate to it. Once there you can type make uninstall to remove all files moved during the install process.

Warning: I’ve read that this can cause issues but have not personally witnessed any.

Note: This method leaves empty directories behind. They do not cause any issues, but if you would like to remove them manually, you can.

Method 2 (more dangerous!)

You can use the command sudo find / -name «*opencv*» -exec rm -i <> \; to locate all files with the word opencv in their name and remove. As is, this command will present a prompt for you to confirm whether or not you want to delete each individual file found. This will take a long time. Caution: Take care when deleting files. Always check the location of the file and ensure that it can safely be deleted before proceeding.

Installing an Older Version of OpenCV

Note: I use gcc and g++ mostly and do not use an IDE. If you would like to use an IDE, additional or different steps may be necessary.

Читайте также:  Диск майл облако linux

Generally, I find the best way to set up OpenCV (and other libraries that I build from source) is to create a folder in my HOME directory called separate-libs (you can name yours whatever you want). Then inside I create a directory for the library itself, extract the source code and compile it with a custom install prefix. When compiling OpenCV with CMake, this is straightforward. Here’s how I did it on my machine:

  • Install all necessary dependencies. This can be tricky, but there are many online guides that detail all of the dependencies needed to compile OpenCV from source.
    • Typically, each release of OpenCV contains a list of required and optional dependencies in the release’s documentation. You can locate it for any particular release by going here and clicking Documentation > OpenCV Tutorials > Introduction to OpenCV > Installation in Linux.
    • There may be optional dependencies that are specific to your needs. It is up to you to find those dependencies. If you don’t know what build options there are for OpenCV look under «OpenCV cmake options» in the CmakeLists.txt file included with the source code.

    After setting up your dependencies, you can build using either the CMake GUI or terminal. For GUI

    • Open and select browse source: then select the folder containing the uncompressed source code.
    • Select browse build: then select the desired build directory
    • Click Add Entry: then click on the dropdown that says BOOL and select PATH. In the name textfield type CMAKE_INSTALL_PREFIX. Then provide an installation path.
    • Click Generate to see available configuration options. Those that have a path at the end means that OpenCV successfully located the library. If not you will either have to install or manually point to the library (if in a non-standard location).
    • Once everything is correctly configured, click generate to create a makefile with those configurations set.
    • Next type make -j$(nproc) . This will compile the code.
      • The -j option for make splits the job into multiple processes.
      • $(nproc) feeds -j the number of processors you have, which will allow for multitasking and quicker compilation.
      • For reference, on a laptop with an i7 and 8GB of RAM, compiling OpenCV with the extra-contrib-modules took roughly 20-30 minutes.

      From Terminal

      • Navigate to your build directory (create one with mkdir if you do not have one) and type cmake -DCMAKE_INSTALL_PREFIX=absolute_path_to_installation_directory -DCMAKE_BUILD_TYPE=»Release» . Add additional -D build_flag = option to suit your needs. Note: do not put a space after or before the equal sign.
      • Once the command is configured with all the options you want, press enter. This shouldn’t take too long.
        • You might see a few errors. Most of them are not severe and will not cause problems.
        • If you forgot an build option, cmake command just used and enter the flag you forgot and press enter to regenerate the makefile.

        Once completed, I use aliases and pkg-config to make compilation easier. In the installation directory in /lib/pkgconfig/ there is a single file called opencv.pc. This is a file that pkg-config can use to automatically configure the library on a need basis. The less secure option is to copy or move this .pc file to a directory where pkg-config looks by default. Since these are system folders, placing files from outside repositories in them is usually advised against. Instead, I open my ~/.bashrc file and at the bottom place the lines export PKG_CONFIG_PATH=»$opencv2prefix/lib/pkgconfig» export LD_LIBRARY_PATH=»$LD_LIBRARY_PATH:$opencv2prefix/lib» alias opencv2=»pkg-config —cflags —libs opencv2″ .

        In the lines above, $opencv2prefix is a variable containing the path to the folder I installed OpenCV in. Instead of the alias command using opencv2, yours will likely be opencv. The opencv2 after —libs refers to the name of the .pc file. This may be different in your case. I changed mine because I have two versions of OpenCV on my machine.

        Now, when I go to compile with gcc or g++, I simply type g++ main.cpp $(opencv2) . Substitute what’s in $() with the name of the alias that performs pkg-config.

        Apt — Uninstall OpenCV 4.2.0 and its Libraries, Simply use ‘remove’ instead of ‘install’. Apt does the cleanup — proper cleanup is a fundamental job of a package manager. So based on what you installed: sudo apt remove libopencv-dev python3-opencv sudo apt remove libjpeg-dev libpng-dev libtiff-dev sudo apt autoremove. You don’t need to update your …

        Источник

Оцените статью
Adblock
detector