Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mobook
GitHub Repository: mobook/mo-book
Path: blob/main/notebooks/appendix/installing-pyomo-and-solvers.ipynb
663 views
Kernel: Python 3 (ipykernel)

Installing Pyomo and Solvers

Pyomo comprises an ecosystem of core modules, third party contributed modules, and many choices of both open-source and commercial solvers. This opens up many options for an experienced user, but can also be a challenging for someone getting started with Pyomo. These notes are intended to help the reader get started by providing instructions for a basic installation of Pyomo with a core set of solvers.

Installing Pyomo and Solvers on Google Colab

Google Colab provides a hosted, cloud-based development environment for notebook applications written in Python. Google Colab provides standardized, preinstalled Python environment that includes many of the Python libraries commonly used in data science applications. For use with Pyomo, the Pyomo package any required solvers must be installed at the start of each new session.

Here we outline several options for installing Pyomo on Google Colab.

HiGHS: Linear and Mixed-Integer Linear Optimization (MILO)

Linear and Mixed-Integer Linear Optimization (MILO) covers a wide range of applications. HiGHS is a high-performance, open-source solver for MILO applications sponsored by COIN-OR. It can be used with Pyomo through the Auto-Persistant Pyomo Solver Interface (APPSI). The HiGHS project provides a convenient pip installer that includes Pyomo and all necessary dependencies.

# install pyomo and HiGHS solver import sys if "google.colab" in sys.modules: !pip install highspy >/dev/null SOLVER = "appsi_highs"

This is the recommended installation for LO and MILO applications on Google Colab using open-source solvers.

Installing Pyomo and Solvers on your laptop

General instructions for installing Pyomo are available in the Pyomo documentation.