[Updated] Comments for OpenCV installation
Followings are my current solution (and some problem I faced). (Anaconda or pyenv are optional for managing several Python environments.)
Install Python3 and pip
$ sudo apt-get install python3 $ sudo apt-get install python3-pip
$ sudo pip3 install numpy
$ sudo apt-get install libblas-dev liblapack-dev $ sudo apt-get install gfortran $ sudo pip3 install scipy
Install Pyside and pyqtgraph
$ sudo apt-get install libqt4-dev $ sudo apt-get install cmake $ sudo pip3 install PySide $ sudo pip3 install pyqtgraph
Install opencv (with Anaconda)
$ conda install -c menpo opencv3=3.1.0
ImportError: libopencv_ccalib.so.3.1: cannot enable executable stack as shared object requires: Invalid argument
When importing opencv (
import cv2), I faced this error. This is a dynamic linking trouble and can be resolved by
$ sudo apt-get install execstack $ sudo execstack -c $HOME/anaconda3/lib/libopencv_*
$ sudo apt-get install gtk2.0-0
[Update] This works well for
>>> import cv2
This functionality is disabled in order to attempt to increase the probability that the automated builds will be useful for as large a range of people as possible. I have made no effort to get the FFMPEG/Video builds working. If this is a requirement I can likely remedy it by adding an FFMPEG conda package.
I believe Python2.7 + OpenCV2 is much easier way to get started with video related functions.
However if you persist to use Python3+, you have to choose some more complicated installation process. So I will post some alternative setting up process for Python3+ + OpenCV3.