This page explains how to install OR-Tools from a binary distribution.
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 Python 2.7+, 3.5, or 3.6:
If necessary, upgrade your Python installation at python.org.
Verify that you have pip 9.01 or higher with
-V. If necessary, upgrade with
pip install --upgrade
pip (on Ubuntu:
2. Install other utilities
If you're on Mac OS X, you must install the Xcode Command Line Tools. To do so, open a Terminal window and enter:
If you're going to use OR-tools from C++ on Linux:
sudo apt-get install g++ make
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
page. (For Linux Ubuntu versions >= 16.04,
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:
pip install --upgrade ortools
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 allThis runs a selection of examples for OR-Tools. If all the examples run successfully, you are ready to start running OR-Tools programs.
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 C++, add
lib/ortools.libto your project libraries, and add
or‑tools/includeto your project include path.
- For Java, use the jar
‑Djava.library.path=PATH_TO_or‑tools/libto your command line.
- For C#, add
bin/Google.OrTools.dllto 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:
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.04, Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Debian 9, Mac, Visual Studio 2017, and Visual Studio 2015.
The instructions for installing OR-tools from source have a troubleshooting section that includes issues with binary installs as well.