Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install OpenCV in CentOS 6. When I run the command

[root@cosmas opt]# sudo yum install libtiff4-dev libjpeg-dev libjasper-dev

it returned the follow:

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * epel: mirror.fraunhofer.de
 * rpmforge: nl.mirror.eurid.eu
Setting up Install Process
No package libtiff4-dev available.
No package libjpeg-dev available.
No package libjasper-dev available.
Error: Nothing to do

What I am doing wrong? Can anyone help me?

share|improve this question
    
github.com/supermasita/ufe/wiki/… I just try that.. and it works.. – user418148 Feb 12 '15 at 6:14

I just did the same install on CentOS 6. Since the install instructions are more geared toward Ubuntu, here is what I was able to do to install it:

  1. install all the required packages using yum

    yum groupinstall "Development Tools" 
    yum install gcc 
    yum install cmake 
    yum install git
    yum install gtk2-devel
    yum install pkgconfig 
    yum install numpy 
    yum install ffmpeg
    
  2. Create working directory and check out the source code

    mkdir /opt/working
    cd /opt/working
    git clone https://github.com/Itseez/opencv.git
    cd opencv
    git checkout tags/2.4.8.2
    
  3. Create the Makefile

    mkdir release
    cd release
    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
    
  4. If using cmake version 2.6-patch 4 (check with cmake --version), then you'll need to comment out a line in the build. Comment out string(MD5 hash "${lines}") on line 50 in /opt/working/opencv/cmake/cl2cpp.cmake. Other options (including updating cmake) can be found at here.

  5. Build and install

    cd /opt/working/opencv/release
    make
    make install
    
share|improve this answer
1  
I tried to install opencv in Centos 6.3 . But still I am getting error message for ImportError: No module named cv2 . Do I need install some additional package for cv2? – Roopendra May 18 '15 at 8:59

sudo yum search all --enablerepo=epel libtiff4-dev libjpeg-dev libjasper-dev

Gives-

libjpeg-devel.x86_64 : Development tools for programs which will use the libjpeg library
Warning: No matches found for: libtiff4-dev
Warning: No matches found for: libjasper-dev

Which makes me think that you have wrong package names. Are you sure that these aren't debian package names?

Anyways in the meanwhile you can install libjpeg-devel.x86_64 via-

sudo yum install --enablerepo=epel libjpeg-dev

share|improve this answer

@Roopendra I met this error too and I tried: cp /usr/local/lib/python2.7/site-packages/cv2.so /usr/lib/python2.7/site-packages and solved it. Source: http://techieroop.com/install-opencv-in-centos/

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .