Installation¶
Pip Install¶
PyEPO requires Python 3.9 or later. Install from PyPI with:
pip install pyepo
Conda Install¶
Install from Anaconda Cloud with:
conda install -c pyepo pyepo
Install from Source¶
Clone PyEPO from GitHub.
git clone -b main --depth 1 https://github.com/khalil-research/PyEPO.git
Install the package from the local checkout.
pip install ./PyEPO/pkg
Solvers¶
PyEPO compiles optimization models onto a solver backend, so at least one solver must be installed. Each backend has a pip extra that installs its package alongside PyEPO:
Gurobi, the default backend; commercial with a free academic license (
pip install pyepo[gurobi]).COPT, commercial with a free academic license (
pip install pyepo[copt]).Pyomo, which drives open solvers such as GLPK, CBC, or HiGHS with no license (
pip install pyepo[pyomo]plus the solver binary).Google OR-Tools, open (
pip install pyepo[ortools]).MPAX, open and JAX-based, for GPU and batch solving (
pip install pyepo[mpax]).
The CaVE loss additionally needs Clarabel (pip install pyepo[cave]), and pip install pyepo[all] installs every optional dependency at once.
Note
A bare pip install pyepo does not install a solver backend, so building a model with the default Gurobi backend requires a Gurobi license; for a license-free setup, use the Pyomo or OR-Tools backend.