Python-MIP requires Python 3.5 or newer. Since Python-MIP is included in the Python Package Index, once you have a Python installation, installing it is as easy as entering in the command prompt:

pip install mip

If the command fails, it may be due to lack of permission to install globally available Python modules. In this case, use:

pip install mip --user

The default installation includes pre-compiled libraries of the MIP Solver CBC for Windows, Linux and MacOS. If you have the commercial solver Gurobi installed in your computer, Python-MIP will automatically use it as long as it finds the Gurobi dynamic loadable library. Gurobi is free for academic use and has an outstanding performance for solving MIPs. Instructions to make it accessible on different operating systems are included bellow.

Gurobi Installation and Configuration (optional)

For the installation of Gurobi you can look at the Quickstart guide for your operating system. Python-MIP will automatically find your Gurobi installation as long as you define the GUROBI_HOME environment variable indicating where Gurobi was installed.

Pypy installation (optional)

Python-MIP is compatible with the just-in-time Python compiler Pypy. Generally, Python code executes much faster in Pypy. Pypy is also more memory efficient. To install Python-MIP as a Pypy package, just call (add --user may be necessary also):

pypy3 -m pip install mip