# Installing OR-Tools for Python from Binary on Windows

## Introduction

This guide explains how to install OR-Tools for Python on Windows.

Although these instructions might also work on other Windows variants, we
have only tested them on machines meeting the following requirements:


Windows 10 64-bit (x86_64) with:

- Microsoft Visual Studio Enterprise 2022
- Microsoft Visual Studio Community 2022 Preview 2 or above

<br />

> [!NOTE]
> **Note:** OR-Tools only supports the **x86_64** (also known as **amd64**) architecture.

## Prerequisites

The following sections describe the prerequisites for installing OR-Tools.

### Microsoft Visual C++ Redistributable

You must have the
[Microsoft Visual C++ Redistributable for Visual Studio 2022](https://visualstudio.microsoft.com/downloads/?q=Visual+C%2B%2B+Redistributable+for+Visual+Studio) (select the x64 version) installed
on your computer, since OR-Tools library for Python is a wrapper for the
C++ native library.

### Python

You must have one of the following versions of Python installed:

- [Python 3.11.x 64-bit](https://www.python.org/downloads/release/python-3110/)
- [Python 3.10.x 64-bit](https://www.python.org/downloads/release/python-3100/)
- [Python 3.9.x 64-bit](https://www.python.org/downloads/release/python-390/)
- [Python 3.8.x 64-bit](https://www.python.org/downloads/release/python-380/)

Then verify that you have pip 9.01 or higher available in your PATH:

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

## Installing OR-Tools

Assuming the prerequisite software is installed on your Windows, take the
following steps:

    python -m pip install ortools

> [!TIP]
> **Tip:** You should install `ortools` in a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#)

### Uninstalling OR-Tools

To uninstall OR-Tools, issue the following commands:

    python -m pip uninstall ortools

## Validate your installation

To test your Python installations, open a x64 Native Tools Command Prompt. Then enter the
following command:


    python -c "import ortools; print(ortools.__version__)"

<br />

If it runs successfully, you are ready to
[get started with OR-Tools](https://developers.google.com/optimization/introduction/python).