Installing OR-Tools (binary)

This page explains how to install OR-Tools from a binary distribution.

Installing on Linux or Mac

Note: binary distributions work on 64-bit machines only.

1. Update your Python configuration

If you're not going to use OR-Tools from Python, skip this step.

Verify that you have a 64-bit Python interpreter (2.7+, 3.5, or 3.6) available in your PATH:

python --version
python -c "import platform; print(platform.architecture()[0])"

If necessary, upgrade your Python installation using your package manager (recommended) or by getting a new version at python.org.

Verify that you have pip 9.01 or higher with:

python -m pip --version

If necessary, upgrade with

python -m pip install pip --upgrade

And if you don't have pip at all, visit either the pip install page or the specific instructions for Linux package managers.

2. Install other utilities

If you're on Mac OS X and want to use a language other than Python, you must install the Xcode command line tools. To do so, open a Terminal window and enter:

xcode-select --install

If you're going to use OR-Tools from C++ on Linux:

sudo apt-get install build-essential

If you're using OR-Tools from C#, you must install Mono version 4.2.0 or later, with 64 bit support. You can download the latest version of Mono from the Mono Download page.

3. Install OR-Tools

There are two separate binary distributions: one for C++, Java, and C#; and a PyPI-based distribution for Python.

Python Windows/Mac/Linux binary distribution: python -m pip install --user --upgrade ortools. Afterward, you can verify installation success with python -m pip show ortools.

C++/Java/C# binary distribution: Mac, Ubuntu 17.10, Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Debian 9.

To test C++/Java/C# installations, open a command window and navigate to the directory where you unpacked binary distribution. Then enter the following command:

make all

This runs a selection of examples for OR-Tools. If all the examples run successfully, you are ready to start running OR-Tools programs.

Installing on Windows

The binary distributions work on 64-bit machines only. They have been tested on Windows 10 under Microsoft Visual Studio 2015 and 2017.

As with Mac and Linux, OR-Tools provides support for C++, Python (versions 2.7, 3.5, and 3.6), Java, and C#. There are two separate binary distributions, one for Python and the other for C++, Java and C#.

To install the binary distribution for Python, follow the instructions at the top of this page for Mac/Linux.

For the C++/Java/C# binary installation, download and install either Visual Studio 2017 the Visual Studio 2015 version.

  • For C++, add lib/ortools.lib to your project libraries, and add or‑tools/include to your project include path.
  • For Java, use the jar in lib/com.google.ortools.lib and add ‑Djava.library.path=PATH_TO_or‑tools/lib to your command line.
  • For C#, add bin/Google.OrTools.dll to your project dependencies.

To test the installation, open a Visual Studio x64 Native Tools Command Prompt and navigate to the directory where you unpacked the archive. Then enter the following command:

make all

This runs a selection of examples for OR-Tools. If all the examples run successfully, you are ready to start running OR-Tools programs.

FlatZinc binary distributions

FlatZinc is a solver input language understood by a wide range of solvers. OR-Tools provides binary distributions with FlatZinc support for the following platforms: Ubuntu 17.10, Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Debian 9, Mac, Visual Studio 2017, and Visual Studio 2015.

Troubleshooting

The instructions for installing OR-Tools from source have a troubleshooting section that includes issues with binary installs as well.

Send feedback about...

Optimization
Optimization