Ask Your Question

Install OpenCV on ubuntu 16.04

asked 2018-01-21 07:15:19 -0500

arunkumar413 gravatar image

Hi All,

I'm trying to install OpenCV on Ubuntu 16.04 but getting this error. I tried sudo-apt-get upgrade and apt-get update commands but still no use. Could you please help me install OpenCV on my system.

Thanks, Arun

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-01-21 07:26:49 -0500

berak gravatar image

updated 2018-01-21 10:39:46 -0500

please do NOT try to install those very outdated prebuilt opencv packages !

instead, follow the receipe here

(use your package manager to install dependancies, but build opencv libs from github src)

edit flag offensive delete link more


I have anaconda distribution with python 3 in my /home/arun/anaconda3 folder.

Is opencv compatible with Anaconda distribution? If yes, how should I install using the Anaconda version of python?. Does the same procedure mentioned in the recipe work with anaconda as well? Command line work is painful. Are we working towards packaging the software for different OS

arunkumar413 gravatar imagearunkumar413 ( 2018-01-22 02:40:49 -0500 )edit

unfortunately, we cannot help you with anaconda or menpo specific problems.

if you build from src, and cmake finds your python install (and a recent numpy), it will build the python bindings as well.

if that somehow did not happen, you'll have to give us more information -- cmake output, make log, etc.

berak gravatar imageberak ( 2018-01-22 04:30:39 -0500 )edit

I used cmake-gui and ran configure and generate. This is what I got

Please confirm if everything is good to go

arunkumar413 gravatar imagearunkumar413 ( 2018-01-23 00:29:43 -0500 )edit

I ran the command: make -j7 and here is the output:

arunkumar413 gravatar imagearunkumar413 ( 2018-01-25 11:17:53 -0500 )edit

truncated at 67% -- not helpful

berak gravatar imageberak ( 2018-01-25 11:25:42 -0500 )edit
arunkumar413 gravatar imagearunkumar413 ( 2018-01-25 23:20:15 -0500 )edit

@berak, it seems that openCV is installed properly ( However when I run the command: import cv2 in python interpreter is throwing a "module not found" error:

arunkumar413 gravatar imagearunkumar413 ( 2018-01-29 10:44:19 -0500 )edit

yea, it never built any python bindings,

install a recent numpy version for the python you want, try again with cmake, and check the output carefully.

berak gravatar imageberak ( 2018-01-29 11:06:29 -0500 )edit

NumPy is already installed on my machine. I tried to install it again but it returned requirement already satisfied

arunkumar413 gravatar imagearunkumar413 ( 2018-01-29 11:16:32 -0500 )edit

try to use cmake-gui this time, type PYTHON into the search box, and try to fill the resp. fields manually, required are : include path, lib and executable

ofc. you need the python c-headers and lib !

berak gravatar imageberak ( 2018-01-29 11:23:26 -0500 )edit

Question Tools

1 follower


Asked: 2018-01-21 07:15:19 -0500

Seen: 460 times

Last updated: Jan 21 '18