Ask Your Question
0

Install OpenCV on ubuntu 16.04

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

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
1

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

berak gravatar image

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

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

Comments

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 -0600 )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 -0600 )edit

I used cmake-gui and ran configure and generate. This is what I got http://dpaste.com/1JRCGC7

Please confirm if everything is good to go

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

I ran the command: make -j7 and here is the output: https://paste.ubuntu.com/26459512/

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

truncated at 67% -- not helpful

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

@berak, it seems that openCV is installed properly (https://paste.ubuntu.com/26484239/). However when I run the command: import cv2 in python interpreter is throwing a "module not found" error: https://paste.ubuntu.com/26484568/

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

yea, it never built any python bindings, http://dpaste.com/1JRCGC7#line-97

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 -0600 )edit

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

https://paste.ubuntu.com/26484804/

arunkumar413 gravatar imagearunkumar413 ( 2018-01-29 11:16:32 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 701 times

Last updated: Jan 21 '18