Put python, numpy, opencv3 in ubuntu14

Introduction

I wanted to use AKAZE, so I installed opencv3. I have python2.7.10 installed with pyenv. Please change to your own version where it is 2.7.10 below.

numpy

Install everything you think you need

$ sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

I was angry if I didn't have the authority, so

$ sudo chmod -R 777 /home/ubuntu/.pyenv/versions/2.7.10/lib/python2.7/site-packages/

I wanted to put numpy1.8 Install by specifying the version of numpy

$ pip install numpy==1.8

opencv Return the python version to system. I installed it without returning it and suffered a lot. No matter how hard you try, you will not be able to find cv2.so that will appear later.

$ pyenv global system

opencv3 installation

$ mkdir opencv
$ cd opencv
$ wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/3.0.0/opencv-3.0.0.zip
$ unzip opencv-3.0.0.zip
$ cd opencv-3.0.0/
$ mkdir build
$ cd build
$ make -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_opencv_java=OFF -D WITH_IPP=OFF -D WITH_1394=OFF -D WITH_FFMPEG=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_DOCS=OFF -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=ON -D BUILD_opencv_video=OFF -D BUILD_opencv_videoio=OFF -D BUILD_opencv_videostab=OFF -D PYTHON_EXECUTABLE=$(which python) ..
$ make
$ sudo make install

You should now have something called cv2.so somewhere.

$ sudo find / -name cv2.so

I'll copy what I find so that python can read it.

$ sudo cp /home/ubuntu/opencv/opencv-3.0.0/build/lib/cv2.so /home/ubuntu/.pyenv/versions/2.7.10/lib/python2.7/site-packages/

Revert the python version.

$ pyenv global 2.7.10

Make sure you can import cv2.

$ python
>> import cv2

If there are no errors, it is successful.

Recommended Posts

Put python, numpy, opencv3 in ubuntu14
Beep in Python (Ubuntu)
Put Python 3.x on Ubuntu
Matrix multiplication in python numpy
Install OpenCV on Ubuntu + python
Make Opencv available in Python
Put numpy scipy etc. in virtualenv of Ubuntu 12.04 LTS Server
Put MeCab in "Windows 10; Python3.5 (64bit)"
Until you put Python in Docker
Self-organizing map in Python NumPy version
Use OpenCV with Python 3 in Window
OpenCV3 & Python3 environment construction on Ubuntu
[Python] Do not put Japanese in the path used by OpenCV
I put Python 2.7 in Sakura VPS 1GB.
Mosaic images in various shapes (Python, OpenCV)
Build Python3 and OpenCV environment on Ubuntu 18.04
[Itertools.permutations] How to put permutations in Python
PUT gzip directly to S3 in Python
How to check opencv version in python
I put Linux (Ubuntu) in VAIO SX14.
Created Ubuntu, Python, OpenCV environment on Docker
(Not yet) Don't put Ubuntu 20.04 in WSL1
Quadtree in Python --2
My Numpy (Python)
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
where in numpy
SendKeys in Python
Meta-analysis in Python
Python2.7 + CentOS7 + OpenCV3
Unittest in python
Put OpenCV in OS X with Homebrew and input / output video with python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
#Python basics (#Numpy 1/2)
Plink in Python
Constant in python
#Python basics (#Numpy 2/2)
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
OpenCV Samples (Python)
[Note] openCV + python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python