Category Archives: Linux

Install OpenCV 3.x with Python 2.7 on Ubuntu

Updated: 10/11/2016

How to Install OpenCV 3.x and Python 2.7+ on Ubuntu

Step 1:

Open a terminal window and update the apt package manager lists and upgrade any currently installed packages:

Step 2:

Install developer tools:

Step 3:

Install packages to open image formats including JPEG, PNG, TIFF, and others:

Step 4:

Install the GIMP toolkit (GTK+) which OpenCV uses to build GUIs:

Step 5:

Install packages to open video formats:

Step 6:

Install libraries that optimize various routines in OpenCV:

Step 7:

Install pip, a package manager for Python: is the official pip website

Step 8:

Install Python 2.7 development tools:

Step 9:

Install numpy because OpenCV stores images as NumPy arrays

This post follows, updates and adds to the instructions from Py Image Search here:

TensorFlow on Windows

TensorFlow is an open source (Apache 2.0) software library for Machine Intelligence created by Google

Windows 7

The two options are:

  • Run in Docker
  • Run in a Linux Virtual Machine (VM)

Windows 10

With the introduction of the Windows Subsystem for Linux (WSL) Windows 10 users have an additional option:

  • Run on Win 10
  • Run in Docker
  • Run in a Linux VM


What does “| tee -a build.log” do?

What does “| tee -a build.log” do?

This command will display the output in the terminal and also write the output to a file called build.log

Let’s examine each part of the command

| (pipe)
allows the output of one program to be sent to another

split the output to the terminal and to the file

appends the input to the given file(s) instead of overwriting

is the name of the file to which the input is written

|& tee configure.log
|& tee make.log
|& tee make.log
|& tee install.log



Adapted from my 12/9/13 post

What does “apt-get upgrade -y” do?

What does “apt-get upgrade -y” / “sudo apt-get upgrade -y” do?

This command will upgrade all packages that have updates available and answer Yes (y) to the subsequent prompt (typically whether or not to continue after displaying the additional disk space that will be used)

After this operation, X kB/MB of additional disk space will be used.
Do you want to continue [Y/n]?
Will continue because the answer alreay provided is Y

Let’s examine each part of the command

execute a command as another user (typically root)

a simple command line interface for downloading and installing packages

Perform an upgrade

Assume Yes to all subsequent queries and do not prompt

Adapted from my 12/10/13 post