Installation¶
BilevelPy is distributed through PyPI and can be installed with any standard Python package manager.
Requirements¶
- Python 3.11–3.14
- Gurobi Optimizer 11.0 or newer
- a valid Gurobi licence
BilevelPy is licensed separately from Gurobi. Installing BilevelPy or
gurobipy does not provide a production or academic Gurobi licence.
Install from PyPI¶
Using pip¶
Using Poetry¶
Both commands install the same BilevelPy release from PyPI. Use pip in a
regular virtual environment and poetry add when BilevelPy should become a
managed dependency of a Poetry project.
Verify the installation¶
You can also verify that Gurobi is available:
Install a specific version¶
For reproducible experiments, pin the exact version used by your project.
pip¶
Poetry¶
Install the development version¶
The latest unreleased version can be installed directly from GitHub.
pip¶
python -m pip install "bilevelpy @ git+https://github.com/Institute-of-Transport-Logistics/bilevelpy.git"
Poetry¶
The development version may contain changes that are not yet part of a stable release.
Contributing from source¶
Clone the repository and install the development dependencies:
git clone https://github.com/Institute-of-Transport-Logistics/bilevelpy.git
cd bilevelpy
poetry install --with dev,docs
Run the tests:
Serve the documentation locally:
Gurobi licensing¶
BilevelPy depends on the proprietary gurobipy package. The Apache License 2.0
applies to BilevelPy itself and does not grant rights to Gurobi Optimizer.
Users are responsible for obtaining and configuring a suitable Gurobi licence. For installation and licence options, consult the official Gurobi documentation.