Installation

We provide different standalone binary packages for OTB-Applications:

  • for Windows platform (Seven or higher)
  • for 64 bits Linux distribution
  • for MacOS X

Other binaries can be available as packages (OSGeo packages, Debian/Ubuntu packages, OpenSuse packages), however be advised that they may not be up-to-date nor delivered with full features. If you want to build from source or if we don’t provide packages for your system, information is available in the Compiling OTB from source section.

You can get latest binary packages from our Download page.

Windows

Before extracting the package, make sure that you have been through the First Steps page

Windows binary packages are available for Windows 10 or higher. They can be downloaded from otb download page .

Extract the archive and use one of the launchers, they contain all applications and their launchers (both command line and graphical launchers are provided):

  • monteverdi.bat: A launcher script for Monteverdi
  • mapla.bat: A launcher script for Mapla
  • otbenv.bat: A script to initialize the environment for OTB executables
  • bin: A folder containing application launchers (otbcli.bat, otbgui.bat) and the DLLs.
  • lib: A folder containing application DLLs.
  • include: A folder containing all the necessary headers to compile OTB based projects.
  • tool: A folder containing useful scripts to test the installation or to uninstall OTB libraries and headers while keeping all the dependencies.

The applications can be launched from the Mapla launcher. If you want to use the otbcli and otbgui launchers, you can initialize a command prompt with otbenv.bat.

The package can be used to compile other projects using OTB (binaries, libraries and headers are included). If you want to build OTB from source using this package, you should first uninstall the specific OTB files from the package to leave only the dependencies (what we call an XDK). You can do it using the supplied script tools/uninstall_otb.bat.

In the package you also have a template project for Visual 2015 OTB Project.zip. This template can be placed in your user Visual 2015 template directory : %USERPROFILE%\Documents\Visual Studio 2015\Templates\ProjectTemplates. The script start_devenv.bat allows to copy the template in that folder and start Visual Studio.

Python bindings

Since OTB 6.7.0 OTB bindings for Python 3.5 are distributed as a binary package. Since OTB 8.0.0, the bindings for Python 3.7 are distributed Please note that using a different Python version may not be compatible with OTB wrappings. If the installation completes without issue, information relating to your Python bindings will be provided.

You must have Python numpy bindings installed in your system. They can be installed locally without admin rights as follows: “pip install –user numpy”. This is to give users the option to select their own existing Python installation rather than the one dibstributed by the OTB package.

By default, bindings for Python 3.7 will be enabled with the otbenv script.

Linux

Before extracting the package, make sure that you have been through the First Steps page

We provide a binary package for GNU/Linux x86_64. This package includes all of the OTB applications along with command line and graphical launchers. It can be downloaded from OTB’s download page.

This package is a self-extractable archive. You may uncompress it with a double-click on the file, or from the command line as follows:

chmod +x OTB-8.1.2-Linux64.run
./OTB-8.1.2-Linux64.run

The self-extractable archive only needs common tools found on most Linux distributions (“sed”, “grep”, “find”, “cat”, “printf”, “ln”, …). However, be aware that it requires tools such as “which” and “file” (they are not always present, for instance when building a container).

Please note that the resulting installation is not meant to be moved, you should uncompress the archive in its final location. Once the archive is extracted, the directory structure consists of:

  • monteverdi.sh: A launcher script for Monteverdi
  • mapla.sh: A launcher script for Mapla
  • otbenv.profile: A script to initialize the environment for OTB executables
  • bin: A folder containing application launchers (otbcli.sh, otbgui.sh), Monteverdi and Mapla.
  • lib: A folder containing all shared libraries and OTB applications.
  • include: A folder containing all the necessary headers to compile OTB based projects.
  • share: A folder containing common resources and copyright mentions.
  • tool: A folder containing useful scripts to test the installation or to uninstall OTB libraries and headers while keeping all the dependencies.

The applications can be launched from the Mapla launcher. If you want to use the otbcli and otbgui launchers, you can initialize your environment with source otbenv.profile.

The package can be used to compile other projects using OTB (binaries, libraries and headers are included). If you want to build OTB from source using this package, you should first uninstall the specific OTB files from the package to leave only the dependencies (what we call an XDK). You can do it using the supplied script tools/uninstall_otb.sh.

Python bindings

Since OTB 8.0.0 OTB bindings for Python 3.8 are distributed as a binary package. (From OTB 6.7 to 7.4, bindings are provided for Python 3.5) Please note that using a different Python version may not be compatible with OTB wrappings. If the installation completes without issue, information relating to your Python bindings will be provided.

You must have Python NumPy bindings installed in your system. They can be installed locally without admin rights as follows: “pip install –user numpy”. This is to give users the option to select their own existing Python installation rather than the one dibstributed by the OTB package.

By default, bindings for Python 3.8 will be enabled with the otbenv script.

Recompiling Python bindings

If you are using another version of Python 3 than 3.8, but still want to use OTB Python bindings, it is possible to compile the python bindings again with your version of Python. CMake is required (it is available in most package managers or at [https://cmake.org/]). Make sure you installed the necessary dependencies in the First Step page

At the root of the OTB installation run :

source otbenv.profile
ctest -S share/otb/swig/build_wrapping.cmake -VV

You should now be able to import otbApplication through Python !

Create an healthy Python environment for OTB

We strongly recommend to use a virtual env to avoid conflicts between OTB and GDAL when you develop python scripts that uses other dependencies like rasterio, scikit…

# Source your OTB environment
. <your installation directory>/otbenv.profile
# Create a virtual env and install some libraries
python -m venv otb_venv
. otb_venv/bin/activate
pip install --upgrade pip
pip install scikit-image scikit-learn geopandas
# Rastero depends on GDAL and need to be compiled on the flight with current OTB's own GDAL
pip install rasterio --no-binary :all:
# Use your libraries within Python
python
> import rasterio
> import otbApplication as otb

Notes:

  • You must use monteverdi and mapla through mapla.sh and monteverdi.sh helper scripts in extracted directory.
  • The helper scripts for monteverdi and mapla set required environment variables
  • You might be tempted to move “OTB-8.1.2-Linux64” into another location say /usr/local/ after extraction. But avoid this action!
  • To have “OTB-8.1.2-Linux64” installed in /usr/local or /opt execute “OTB-8.1.2-Linux64.run” in that directory.
  • Multiple installation of OTB can exists in same system without one conflicting the other!

FAQ

Q: Unable to import otbApplication library with Python3.8

ImportError: libpython3.8m.so.rh-python38-1.0: cannot open shared object file: No such file or directory

A: You need to add a symlink to libpython3.8m.so.rh-python38-1.0 to make it work.

Here is the solution:

  • Find the libpython3.8XX on your system : find /usr/lib -iname *libpython3.8* (on Ubuntu 20.04, it is /usr/lib/x86_64-linux-gnu/libpython3.8m.so)
  • Create a symlink : ln -s path/to/lib/python3.8XX path/to/lib/libpython3.8m.so.rh-python38-1.0
  • Try to import otbApplication again

See this discussion on OTB issue tracker

MacOS X

We provide for MacOS X through a standalone package. This package is a self-extractible archive, quite similar to the Linux one.

This package was compiled using an Intel processor, and won’t be compatible with ARM processors found in the most recent MacOS computers. If you want to use OTB on such a device, we recommend using the Docker image (see below).

You may uncompress it with the command line:

chmod +x OTB-8.1.2-Darwin64.run
./OTB-8.1.2-Darwin64.run

Once the archive is extracted, you can see OTB-8.1.2-Darwin64 directory in the same direcrtory along with OTB-8.1.2-Darwin64.run

Contents of OTB-8.1.2-Darwin64 is briefly listed below:

  • Monteverdi.app: A Mac OSX .app for Monteverdi
  • Mapla.app: A Mac OSX .app for Mapla.
  • bin: A folder containing application launchers (otbcli.sh, otbgui.sh), monteverdi and mapla binaries.
  • lib: A folder containing all shared libraries and OTB applications.
  • include: A folder containing all the necessary headers to compile OTB based projects.
  • share: A folder containing common resources and copyright mentions.
  • tool: A folder containing useful scripts to test the installation or to uninstall OTB libraries and headers while keeping all the dependencies.

The applications can be launched from the Mapla launcher. If you want to use the otbcli and otbgui launchers, you can initialize your environment with source otbenv.profile.

The package can be used to compile other projects using OTB (binaries, libraries and headers are included). If you want to build OTB from source using this package, you should first uninstall the specific OTB files from the package to leave only the dependencies (what we call an XDK). You can do it using the supplied script tools/uninstall_otb.sh.

Python bindings

Since OTB 6.7.0 OTB bindings for Python 3.7 are distributed as a binary package. Please note that using a different Python version may not be compatible with OTB wrappings. If the installation completes without issue, information relating to your Python bindings will be provided.

You must have Python numpy bindings installed in your system. They can be installed locally without admin rights as follows: “pip install –user numpy”. This is to give users the option to select their own existing Python installation rather than the one dibstributed by the OTB package.

By default, bindings for Python 3.7 will be enabled with the otbenv script.

Recompiling Python bindings

If you are using another version of Python 3 than 3.7, but still want to use OTB Python bindings, it is possible to compile the python bindings again with your version of Python. CMake is required (it is available in Brew or at [https://cmake.org/]). At the root of the OTB installation run :

source otbenv.profile
ctest -S share/otb/swig/build_wrapping.cmake -VV

You should now be able to import otbApplication through Python !

Notes:

  • If you want to use the otbcli and otbgui launchers, you must access them via a terminal prompt.
  • The OSX .app are provided for monteverdi (viewer) and mapla (application browser).
  • You must use monteverdi and mapla through their .app files only.
  • You are allowed to move these .app files and refrain from moving or deleting OTB-8.1.2-Darwin64 after extraction. In case you need to have OTB installed in some other directory. Extract the .run file there.

FAQ

Q: I am getting an error message…

xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun

A: You can get this error at startup running Monteverdi.app or Mapla.app. The solution is to run in a terminal the following command:

xcode-select --install

And then try to restart Monteverdi or Mapla.

Docker image

A Docker image is available on DockerHub. It can be used on any device running Docker, and provides python 3.8.

docker pull orfeotoolbox/otb

To run CLI tools, you can launch the docker image with:

docker run -it orfeotoolbox/otb

If you are planning on using the GUI applications, you have to call docker with the following arguments:

docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ --device=/dev/dri:/dev/dri orfeotoolbox/otb monteverdi

Conda package

A conda package is available for Orfeo Toolbox on Linux. It can be found at https://anaconda.org/orfeotoolbox/otb and can be installed with the command

conda install -c orfeotoolbox otb

Other packages

Warning! These packages may not be up-to-date with latest OTB releases. In addition, some features of the library may not be available on every platform. Some of these are not maintained by the OTB-team. If you want to get involved in the packaging of OTB for your favourite platform, please contact us through the developer’s mailing list: otb-developers@googlegroups.com.

Debian

There are OTB packages for Debian (unstable) since version 5.2.0. OTB Applications packages may be available as Debian packages through APT repositories:

  • otb-bin for command line applications
  • otb-bin-qt for Qt applications
  • python-otb for python applications

Due to license issues, the OTB package built in Debian doesn’t contain 6S. As a consequence, the package does not contain the OpticalCalibration application.

Ubuntu

For Ubuntu 12.04 and higher, OTB Applications packages may be available as Debian packages through APT repositories:

  • otb-bin for command line applications
  • otb-bin-qt for Qt applications
  • python-otb for python applications

Since release 3.14.1, OTB Applications packages are available in the ubuntugis-unstable repository.

Since release 5.2.0, the Ubuntu packages derive from the Debian packages.

You can add it by using these command-lines:

sudo aptitude install add-apt-repository
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable

You will then need to run:

sudo aptitude install otb-bin otb-bin-qt python-otb

If you are using Synaptic, you can add the repositories, update and install the packages through the graphical user interface.

For further information about Ubuntu packages go to ubuntugis-unstable launchpad page and click on Read about installing.

apt-add-repository will try to retrieve the GPG keys of the repositories to certify the origin of the packages. If you are behind a http proxy, this step won’t work and apt-add-repository will stall and eventually quit. You can temporarily ignore this error and proceed with the update step. Following this, aptitude update will issue a warning about a signature problem. This warning won’t prevent you from installing the packages.

OpenSuse

For OpenSuse 12.X and higher, OTB Applications packages are available through zypper.

First, you need to add the appropriate repositories with the following commands (please replace 11.4 with your version of OpenSuse):

sudo zypper ar
http://download.opensuse.org/repositories/games/openSUSE_11.4/ Games
sudo zypper ar
http://download.opensuse.org/repositories/Application:/Geo/openSUSE_11.4/ GEO
sudo zypper ar
http://download.opensuse.org/repositories/home:/tzotsos/openSUSE_11.4/ tzotsos

You should then run:

sudo zypper refresh
sudo zypper install OrfeoToolbox
sudo zypper install OrfeoToolbox-python

Alternatively you can use the One-Click Installer from the openSUSE Download page or add the above repositories and install through Yast Package Management.

There is also support for the recently introduced ’rolling’ openSUSE distribution named ’Tumbleweed’. For Tumbleweed you need to add the following repositories with these command-lines:

sudo zypper ar
http://download.opensuse.org/repositories/games/openSUSE_Tumbleweed/ Games
sudo zypper ar
http://download.opensuse.org/repositories/Application:/Geo/openSUSE_Tumbleweed/ GEO
sudo zypper ar
http://download.opensuse.org/repositories/home:/tzotsos/openSUSE_Tumbleweed/ tzotsos

and then add the OTB packages as shown above.

Archlinux

Package is in AUR (Arch User Repository). You will then need to run (if you use yaourt, you could use trizen instead):

yaourt -S orfeo-toolbox