ERR: "Biopython requires Python 3.6 or later. Python 2.7 detected". Even though I'm running python version 3.10.6 - docker

I'm trying to build a docker image from the docker file:
FROM ubuntu:18.04
# Install tzdata
RUN apt-get update &&\
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
# Install Python, Bowtie2 and Java
RUN apt-get install -y python3.10 python3-pip \
openjdk-8-jdk \
bowtie2 \
wget
RUN apt-get install --yes --no-install-recommends \
zlib1g-dev \
libbz2-dev \
liblzma-dev
# Install RSeQC
RUN apt-get install -y python-pip &&\
pip install RSeQC
# Install biopython=1.80
RUN pip install biopython
# Install Atria
RUN wget https://github.com/cihga39871/Atria/releases/download/v3.1.2/atria-3.1.2-linux.tar.gz && \
tar -zxf atria-3.1.2-linux.tar.gz && \
mv atria-3.1.2/bin/atria /usr/local/bin/atria && \
chmod +x /usr/local/bin/atria
#Atria dependencies
RUN apt-get install pigz pbzip2
# Install findtail
RUN wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/findtail/findtail_v1.01 && \
mv findtail_v1.01 /usr/local/bin/findtail_v1.01 && \
chmod +x /usr/local/bin/findtail_v1.01
# Cleanup
RUN apt clean
But while on Step 6/10 : RUN pip install biopython it gives the error :
---> Running in 062f9c27cc15
Collecting biopython
Downloading https://files.pythonhosted.org/packages/3d/2f/d9df24de05d651c5e686ee8fea3afe3985c03ef9ca02f4cc1e7ea10aa31e/biopython-1.77.tar.gz (16.8MB)
Complete output from command python setup.py egg_info:
Biopython requires Python 3.6 or later. Python 2.7 detected.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mgUybW/biopython/
The command '/bin/sh -c pip install biopython' returned a non-zero code: 1
I've check the python version on my pc. I'm running python version 3.10.6 on my OS and in the dockerfile I'm trying to incorporate python 3.10 version. Where is this error coming from?

The default Python version in Ubuntu 18.04 is 3.6. However, on line 19, you are installing the python-pip package, i.e. the Python 2 version of the pip package manager, which in turn depends on the Python 2.7 package and thus will install Python 2.7.
Which means from this point on, you have two Python versions installed on the system, with two Python VM executables, python and python3, and two pip executables, pip and pip3.
It is not clear why you install Python 2.7 and python-pip on line 19 when you have already installed Python 3.10 and python3-pip on line 8. Nor is it clear why you install BioPython using pip, i.e. the Python 2 version instead of pip3, i.e. the Python 3 version.
I would not install Python 2 at all, since it has not been maintained or supported for several years. I would also not use Ubuntu 18.04, which will be out of standard support in 4 months, unless you are paying for the Extended Security Maintenance. The latest Long-Term Support version of Ubuntu is 22.04.1 which has standard support until April 2027 and extended support until April 2032.

Related

OpenSSL critical Vulnerability in AzureML Model Deployment to Kubernetes

I have an issue with OpenSSL, I am using the following command to install the latest version of OpenSSL in my Base Docker Image of Azure ML Deployment as the older version has some critical security vulnerability. However, the final image still has the older versions of OPENSSL, it could either be that or AzureML is installing the packages by itself, can anyone tell me how to get past this issue? or delete older versions of OpenSSL?
FROM ubuntu:18.04
# Install dependencies:
RUN apt-get update && apt-get -y install openssl
To install OpenSSL based on the required version, we need to install PERL first, then go with the OpenSSL installation based on the version required.
# Install PERL before going with Open SSL
RUN apt-get update \
&& apt-get install -y ca-certificates wget bash \
&& apt-get -qy install perl
Remove the current existing version of OpenSSL
RUN apt-get -y remove openssl
Run the installation through TAR Command
RUN apt-get -qy install gcc
RUN apt-get -q update && apt-get -qy install wget make \
&& wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz\
&& tar -xzvf openssl-1.1.1o.tar.gz \
&& cd openssl-1.1.1o \
&& ./config \
&& make install
Based on the TAR file and the version, it will install the updated version of OpenSSL.
We can’t directly install using apt-get command.

install php7.4 on ubuntu 16.04 - Dockerfile

I am trying to install php7.4 and related packages with below commands
FROM ubuntu:16.04
RUN apt update \
&& apt install -y software-properties-common\
&& add-apt-repository ppa:ondrej/php \
&& apt-get update \
&& apt-get install -y php7.4
I get the below message
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'
on searching with
apt-cache search php7
I see that only 7.0 related packages are available
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
I am confused why I am not getting the newer versions as 7.3, 7,4 and 8 should be the only ones available today. How can I get php7.4 packages?
TL;DR: Since Ubuntu 16.04 reached "End of Standard Support", packages for it were removed from the PPA.
You might want to read this: https://github.com/oerdnj/deb.sury.org/issues/1567
In April 2021, Ubuntu 16.04 Xenial will reach End of Standard Support and will be available only as a paid option through Ubuntu Extended Security Maintenance.
What does it mean for DEB.SURY.ORG PPAs?
The packages for Ubuntu 16.04 will be deleted shortly after the EoL/EoSS is announced, usually at the same time as the next PHP release is published because it's not possible to build the packages any more.
The packages for Ubuntu 16.04 will be available via PHP LTS by Freexian paid program. This is cheaper option than previously announced Private dedicated repositories.
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y wget tar make
RUN wget https://www.php.net/distributions/php-7.4.33.tar.gz --no-check-certificate
RUN tar xzf php-7.4.33.tar.gz
RUN cd php-7.4.33
RUN apt-get update
RUN apt-get --assume-yes install gcc
RUN apt-get -y install expect
RUN apt-get -y install pkg-config
RUN apt-get --assume-yes install -y libsqlite3-dev
RUN apt-get --assume-yes install -y libxml2-dev
RUN ./php-7.4.33/configure
RUN make
RUN make install
CMD ["/bin/bash"]
Install PHP 7.4 on Ubuntu 20.04
NOTE: Ubuntu 20.04 ships with PHP 7.4 in its upstream repositories. Just install it and the extensions you with the apt package manager.
sudo apt update
sudo apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
Confirm PHP version:
$ php --version
PHP 7.4.3 (cli) (built: Mar 26 2020 20:24:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
Install PHP 7.4 on Ubuntu 18.04/16.04
Step 1: Add PHP PPA Repository
We’ll add ppa:ondrej/php PPA repository which has the latest build packages of PHP.
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Step 2: Install PHP 7.4 on Ubuntu 18.04/19.04/16.04
Install PHP 7.4 on Ubuntu 18.04/19.04/16.04 using the command:
sudo apt -y install php7.4
Check version installed:
$ php -v
PHP 7.4.0beta4 (cli) (built: Aug 28 2019 11:41:49) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0beta4, Copyright (c), by Zend Technologies
Use the next command to install additional packages:
sudo apt-get install php7.4-xxx
Example:
sudo apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip,common}
PHP configurations related to Apache is stored in /etc/php/7.4/apache2/php.ini
I hope my experience help you guys

Docker build works fine on ArchLinux (docker 20.10.5) but fails on Ubuntu (docker 19.03.8)

I have this very simple Dockerfile:
FROM ubuntu:21.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y curl doxygen git build-essential python3-dev python3-venv python3-setuptools clang clang-tidy clang-format cppcheck clazy \
&& apt-get install -y npm nodejs cmake ninja-build qtbase5-dev qtdeclarative5-dev \
&& apt-get install -y icecc qtlocation5-dev qtpositioning5-dev libqt5websockets5-dev qtwebengine5-dev libqt5webchannel5-dev qtbase5-private-dev \
&& apt-get install -y libdw-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
...
This builds totally fine in ArchLinux with Docker 20.10.5 but generates the following error in Ubuntu with Docker 19.03.8:
Setting up hunspell-en-us (1:2019.10.06-1) ...
Error: update-dictcommon-hunspell not present or executable. Missing dependency on dictionaries-common?
dpkg: error processing package hunspell-en-us (--configure):
installed hunspell-en-us package post-installation script subprocess returned error exit status 1
and many other errors as a consequence of this one.
My question is: aren't docker builds expected to be reproducible in any environment? Both builds are using the same base image and, therefore, I assume they are also using the same package repositories when building on Ubuntu and ArchLinux. What's the reason for working in ArchLinux and failing on Ubuntu?

Dockerfile fails with llvm-config error for numba install

My Dockerfile using a pypy base fails with FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' when installing llvmlite, a dependency of numba which is listed in my requirements.txt
I tried to follow and update the instructions here
Python numba / llvmlite on Debian 8 - i can't build llvmlite
My error in more detail:
Building wheels for collected packages: llvmlite
Building wheel for llvmlite (setup.py): started
Building wheel for llvmlite (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/pypy3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ux49fegr/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ux49fegr/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8s6wwump --python-tag pp371
cwd: /tmp/pip-install-ux49fegr/llvmlite/
Complete output (26 lines):
running bdist_wheel
/usr/local/bin/pypy3 /tmp/pip-install-ux49fegr/llvmlite/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/tmp/pip-install-ux49fegr/llvmlite/ffi/build.py", line 105, in main_posix
out = subprocess.check_output([llvm_config, '--version'])
File "/usr/local/lib-python/3/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/local/lib-python/3/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/lib-python/3/subprocess.py", line 722, in __init__
restore_signals, start_new_session)
File "/usr/local/lib-python/3/subprocess.py", line 1354, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'
I don't want the heavy weight of a conda installation. Is there a way to achieve a numba install for pypy without it?
FROM pypy:3.6-slim-stretch
RUN apt-get update && apt-get install -y gnupg wget software-properties-common
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - 15CF4D18AF4F7421
RUN apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main"
RUN apt-get update
RUN apt-get -y install cython python-llvm build-essential libedit-dev
RUN apt-get -y install libllvm6.0 llvm-6.0-dev llvm-dev
RUN pip install enum34
ENV LLVM_CONFIG=/usr/lib/llvm-6.0-dev/bin/llvm-config pip install llvmlite
ENV LLVM_CONFIG=/usr/lib/llvm-6.0-dev/bin/llvm-config pip install numba
# ENV LD_LIBRARY_PATH /usr/lib/llvm-6.0-dev/lib/
#... other stuff
RUN apt-get clean && apt-get -y update
RUN apt-get -y install python3-dev \
&& apt-get -y install build-essential
# Add requirements
COPY requirements.txt /tmp/
# Install sphinx first as it does not work inside requirements
RUN pip install -U pip && pip install -U sphinx && pip install numpy && pip install cython && \
pip install -r /tmp/requirements.txt
I expect a clean build of the docker image with numba on pypy
WORKAROUND If the error appeared after April the 17th (they released a new version, see history).
As a workaround try installing a previous version
pip3 install llvmlite==0.31.0
At the moment numba won't install on python 3.9.
I changed my base docker image from python:3.9-slim to python:3.8-slim and then pip install numba succeeded
This fixed it for me -
RUN echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" >> /etc/apt/sources.list
RUN echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" >> /etc/apt/sources.list
RUN apt-get install -y --no-install-recommends libedit-dev build-essential
RUN apt-get install -y --no-install-recommends llvm-8 llvm-8-dev
RUN LLVM_CONFIG=/usr/bin/llvm-config-8 pip3 install enum34 llvmlite numba
Used version 8, because got an error with the latest llvm version -
RuntimeError: Building llvmlite requires LLVM 7.0.x, 7.1.x or 8.0.x, got '3.7.1'
Reference - https://apt.llvm.org/
The "real" solution would be to encourage llvmlite and/or numba to release a wheel for pypy. But for the immediate problem...
Somehow you are missing an llvm installation, at least according to apt-file:
$ apt-file find llvm-config |grep llvm-6
llvm-6.0: /usr/bin/llvm-config-6.0
llvm-6.0: /usr/lib/llvm-6.0/bin/llvm-config
llvm-6.0: /usr/share/man/man1/llvm-config-6.0.1.gz
For installing numba on Python 3.9 on macOS, the following works:
# install llvm using MacPorts
sudo port install llvm-10
sudo port install llvm_select
sudo port select --set llvm mp-llvm-10
# set environment variable used when building `llvmlite`
export LLVM_CONFIG=/opt/local/bin/llvm-config
# clone, build, and install `llvmlite`
# http://llvmlite.pydata.org/en/latest/admin-guide/install.html#compiling-llvmlite
git clone git#github.com:numba/llvmlite.git
cd llvmlite
python setup.py build
python runtests.py
python setup.py install
cd ..
# clone, build, and install `numba`
# https://numba.readthedocs.io/en/stable/user/installing.html#installing-from-source
git clone git#github.com:numba/numba.git
cd numba
export PATH=/usr/bin/:$PATH # use clang, same as used for building Python 3.9
pip install -v .
cd ..
The above are with:
llvmlite at commit 334411cf638c8e06ba19bfda16b07dd64e9dac3c, and
numba at commit ca8132ba5e43fc3f79767046ed55217aeeabb35e.
according to https://askubuntu.com/questions/1286131/how-do-i-install-llvm-10-on-ubuntu-18-04
I added to Dockerfile the lines
RUN apt-get -y install llvm-10*
RUN rm -f /usr/bin/llvm-config
RUN ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config
and It worked (llvmlite installed)
This is the solution, obtained from this github issues thread, that worked for me! Essentially, pip just needed an upgrade in the Dockerfile before installing libraries. All I needed to do was add this line in my Dockerfile:
--upgrade pip \
Here is the sample of my Dockerfile:
# Docker commands here ...
RUN APT_INSTALL="apt-get install -y " && \
PIP_INSTALL="python3 -m pip install " && \
apt-get update && \
# more docker commands here ...
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
python3.6 \
python3.6-dev \
python3-distutils-extra \
python3-pip && \
ln -s /usr/bin/python3.6 /usr/local/bin/python3 && \
$PIP_INSTALL \
--upgrade pip \ # adding this line was my solution
setuptools \
&& \
$PIP_INSTALL \
numpy==1.18.5 \
# more docker commands here...
This is for python 3.6

Installing OpenCV in Tinker Board

I have downloaded 20170817-tinker-board-linaro-stretch-alip-v2.0.1.img for Tinker Board. I am trying to install OpenCV 3.0.0. I have followed the instructions given here : http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/.
I was not able to install libjasper-dev. Hence, instead of libpng12-dev, I have installed libpng.
I am trying to compile OpenCV on Tinker Board since yesterday morning. But have been getting following errors during building process:
/usr/include/c++/6/cmath:106:11: error: ::acos has not been declared
Followed by all the math formula triggers similar errors.
Which Debian version is stable for OpenCV? Should I install a lower version of OpenCV? Can someone help?
I successfully managed to install OpenCV on a TinkerBoard. The following were the steps:
Format a 16 GB memory card to FAT32
Download debian image 20170817-tinker-board-linaro-stretch-alip-v2.0.1.img for tinker board from here.
Copy the img file on to the memory card
sudo dd if=/path/to/your/imgfile of=/path/to/your/memorycard bs=4M
a lot of help on this is already available in SO.
Before powering on ensure that you connect your tinker board to the internet through a lan cable.
Once powered on reset the system time with sudo dpkg-reconfigure tzdata. Debian image for tinker board already has ntp installed. Wait a couple of minutes for the tinker board to adjust the board time from the network.
To install opencv and its dependant library, I have taken the instructions given here ....though I had to make some custom library installations but it was very helpful. Please note, my purpose of using Opencv on Tinker Board is to process live video's and hence my focus was more towards installing appropriate video codecs.
The following were the steps:
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
You may face the following warning messages during installation of perl applications:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Though this doesn't impact your installation of OpenCV, after spending 3 days in trying to compile Opencv on tinker board I do not want to leave anything for a chance.
Use the following to suppress these warning messages:
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
dpkg-reconfigure locales
Thanks to this post.
# INSTALL THE DEPENDENCIES
# Build tools:
sudo apt-get install -y build-essential cmake
# GUI (if you want to use GTK instead of Qt, replace 'qt5-default' with 'libgtkglext1-dev' and remove '-DWITH_QT=ON' option in CMake): I just went with qt5 itself.
sudo apt-get install -y qt5-default libvtk6-dev
# Media I/O:
sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev
Pls note libjasper-dev is unavailable for this version of Debian and hence I have removed from the above Media I/O list.
# Video I/O:
sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev
sudo apt-get install -y gstreamer1.0-plugins-*
sudo apt-get install libxine-dev
# Parallelism and linear algebra libraries:
sudo apt-get install -y libtbb-dev libeigen3-dev
# Python:
sudo apt-get install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpy
sudo apt-get install python-pip
# Java:
sudo apt-get install -y ant default-jdk
# Documentation:
sudo apt-get install -y doxygen
Get OpenCV. I decided to go with version 3.0.0 as my development was in this version. You may choose a different version.
sudo apt-get install -y unzip wget
wget https://github.com/opencv/opencv/archive/3.0.0.zip
unzip 3.0.0.zip
rm 3.0.0.zip
Build OpenCV.
mv opencv-3.0.0 OpenCV
cd OpenCV
mkdir build
cd build
cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_FFMPEG=0 -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DENABLE_PRECOMPILED_HEADERS=OFF ..
A change here from the original script - is the addition of -DWITH_FFMPEG=0, as FFMPEG library was missing and I was not in a frame of mind to install the same. You may want to do so.
make
Though TinkerBoard supports make -j4 i chose to go slow with make. The compile with make took almost 2.5 hours with lot of seemingly indentation errors in c++ codes but finally the compile gets over.
sudo make install
sudo ldconfig
$ python
>>> import cv2
>>> cv2.__version__
'3.0.0'
After few days finally I got good setup. My post improves the previous answer.
Steps is similar like it was before me, but I changed few strings, because I had different errors.
In my case for new Asus Tinker Board I installed:
20170928-tinker-board-linaro-stretch-alip-v2.0.3
opencv-3.3.0 with opencv_contrib-3.3.0.
First start of tinker board.
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
It necessary to remove default (old) OpenCV:
sudo apt-get remove libopencv*
sudo apt-get -y autoremove
# INSTALL THE DEPENDENCIES
# Build tools:
sudo apt-get install -y build-essential cmake
# GUI (I had errors with Qt, so I did next)
sudo apt-get install -y libgtkglext1-dev libvtk6-dev
# Media I/O:
sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev
# Video I/O:
sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev libxine-dev
sudo apt-get install -y gstreamer1.0-plugins-*
# Parallelism and linear algebra libraries:
sudo apt-get install -y libtbb-dev libeigen3-dev
# Python:
sudo apt-get install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpy
sudo apt-get install python-pip
# Java:
sudo apt-get install -y ant default-jdk
# Documentation:
sudo apt-get install -y doxygen
Get OpenCV.
cd ~
wget -O opencv.zip https://github.com/opencv/opencv/archive/3.3.0.zip
unzip opencv.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.3.0.zip
unzip opencv_contrib.zip
Compile and Install OpenCV
cd ~/opencv-3.3.0/
mkdir build
cd build
cmake -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_FFMPEG=0 -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules -DENABLE_PRECOMPILED_HEADERS=OFF ..
CMake should start to build your configuration, after a couple of minutes you should see:
-- Configuring done
-- Generating done
-- Build files have been written to: ./opencv-3.3.0/build
If you can't see Generating done then some issues have been occurred. Read error messages and the error log file to investigate.
I did without examples, but you can try. Qt I deleted.
make
Better without -j4.
sudo make install
sudo ldconfig
Test the installation
linaro#tinkerboard:~$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.3.0'
installing ffmpeg ( the previous answers skiped this )
sudo apt update && sudo apt install ffmpeg libav-tools x264 x265
I also recommend installing the additional packages and enabling neon and vfpv3 when compiling the opncv files. This should give significant improvement in performance:
https://www.pyimagesearch.com/2017/10/09/optimizing-opencv-on-the-raspberry-pi/
I came to this question late. I am adding this answer for the future reference of the people. Here is the official documentation of Tinkerboard.
https://tinkerboarding.co.uk/wiki/index.php/CSI-camera
I just changed the version to the latest version at this time (3.4.1):
#!/bin/bash
#Install
sudo apt-get update
sudo apt-get upgrade
#Install a few developer tools
sudo apt-get install -y build-essential git cmake pkg-config
#Install image I/O packages which allow us to load image file formats such as JPEG, PNG, TIFF, etc.
sudo apt-get install -y libjpeg-dev libtiff5-dev libpng-dev
#Install video I/O packages
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
#Install the GTK development library
sudo apt-get install -y libgtk2.0-dev
#Various operations inside of OpenCV (such as matrix operations) can be optimized using added dependencies
sudo apt-get install -y libatlas-base-dev gfortran
#Install the Python 2.7 and Python 3 header files
sudo apt-get install -y python2.7-dev python3-dev python-opencv
wget https://github.com/opencv/opencv/archive/3.4.1.zip
unzip 3.4.1.zip
cd opencv-3.4.1
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D WITH_LIBV4L=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make install
It took around 90 minutes to compile.

Resources