AI-generated Key Takeaways
- 
          This guide provides instructions for installing Google's OR-Tools for Python on various Linux distributions, specifically targeting the x86_64 architecture. 
- 
          Before installing OR-Tools, ensure you have Python 3.8+ and pip installed, with distribution-specific commands provided for installation. 
- 
          OR-Tools can be easily installed using pip with the command python3 -m pip install ortools, and it's recommended to use a virtual environment.
- 
          You can validate your OR-Tools installation by running python3 -c "import ortools; print(ortools.__version__)", which should print the installed version.
Introduction
This guide explains how to install OR-Tools for Python on Linux.
Although these instructions might also work on other Linux variants, we have only tested them on machines meeting the following requirements:
- Alpine Edge 64-bit (x86_64)
- Centos 7 LTS 64-bit (x86_64)
- Debian SID 64-bit (x86_64)
- Debian 11 (bullseye) 64-bit (x86_64)
- Fedora 38 64-bit (x86_64)
- Fedora 37 64-bit (x86_64)
- OpenSuse Leap 64-bit (x86_64)
- Ubuntu 24.10 64-bit (x86_64)
- Ubuntu 22.04 LTS 64-bit (x86_64)
- Ubuntu 20.04 LTS 64-bit (x86_64)
Prerequisites
The following sections describe the prerequisites for installing OR-Tools.
Python
You must have Python 3.8+ installed.
To install Python 3.8+, open a terminal window and enter:
Alpine
apk add python3-dev py3-pip py3-wheelCentos
sudo yum install -y python3 python3-devel python3-pip numpyDebian
sudo apt install -y python3-dev python3-pip python3-venvFedora
sudo dnf install -y python3-devel python3-pip python3-venvFedora
sudo dnf install -y python3-devel python3-pip python3-venvOpenSUSE
sudo zypper install -y python3-devel python3-pip python3-wheelUbuntu
sudo apt install -y python3-dev python3-pip python3-venvUbuntu
sudo apt install -y python3-dev python3-pip python3-venvUbuntu
sudo apt install -y python3-dev python3-pip python3-venvYou can check your Python 3 installation using:
python3 --versionpython3 -c "import platform; print(platform.architecture()[0])"python3 -m pip --version
Installing OR-Tools
Assuming the prerequisite software is installed on your Linux, take the following steps:
python3 -m pip install ortoolsUninstalling OR-Tools
To uninstall OR-Tools, issue the following commands:
python3 -m pip uninstall ortoolsValidate your installation
To test your Python installations, open a terminal window. Then enter the following command:
python3 -c "import ortools; print(ortools.__version__)"If it runs successfully, you are ready to get started with OR-Tools.
