pyomo
The Pyomo optimization modeling framework
What it is and what it does
Pyomo is a Python-based optimization modeling framework that lets you define mathematical optimization problems symbolically and solve them using external solvers. It abstracts away the low-level details of problem formulation, allowing you to write optimization models in readable Python code rather than solver-specific syntax. The framework supports a wide range of problem types—from simple linear programs to complex mixed-integer stochastic programs and differential algebraic equations—making it suitable for research, prototyping, and production optimization workflows.
You use Pyomo to build a model object, define variables and constraints, specify an objective function, and then pass the model to a solver of your choice. The package itself contains no solver; it is a modeling and scripting layer that translates your Python code into solver input formats. This design allows you to switch solvers without rewriting your model, and to leverage Python's full programming capabilities—loops, conditionals, data structures—within your optimization workflow.
Use it for:
- Formulate and solve linear or mixed-integer programming problems for supply chain, scheduling, or resource allocation.
- Build stochastic optimization models for decision-making under uncertainty in energy, finance, or operations.
- Prototype nonlinear optimization problems in research or engineering without learning solver-specific languages.
- Develop high-level optimization tools or frameworks that abstract Pyomo's modeling layer for domain-specific users.
- Combine optimization with Python data analysis (pandas, numpy) in a single workflow for end-to-end decision support.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyomo is a Python framework for formulating and solving optimization problems, supporting linear, quadratic, nonlinear, mixed-integer, stochastic, and constraint programming models with external solvers.
Yes. Pyomo is production-stable, actively maintained, permissively licensed, and has no install friction. It is the standard choice for optimization modeling in Python when you need flexibility across problem types and solvers. Install it if you are solving any optimization problem and want to work in Python; the main gotcha is that you must separately install or configure a solver backend.
Install
pyomo on PyPI
pip
pip install pyomouv
uv add pyomopoetry
poetry add pyomoInstalling pyomo
Before you install
Low friction installation via pip; actively maintained with recent releases and 2505 GitHub stars. Tested on CPython 3.10–3.14 and PyPy 3.11, with no runtime dependencies to manage.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution and license inclusion required.
Quickstart
pip install pyomo
from pyomo.environ import ConcreteModel, Var, Objective, Constraint, SolverFactory
model = ConcreteModel()
model.x = Var(bounds=(0, 10))
model.obj = Objective(expr=model.x**2)
solver = SolverFactory('ipopt')
results = solver.solve(model)
Requires an external solver (e.g., ipopt, glpk, cplex) to be installed separately; Pyomo itself is a modeling layer only.
Verify before relying
- Whether specific solvers (ipopt, glpk, cplex, gurobi, etc.) are pre-packaged or must be installed separately.
- Performance characteristics for large-scale problems (model size limits, solve time expectations).
- Availability of GPU acceleration or parallel solving capabilities.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 71 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,423,318/month — #3,921 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyomo-6.10.1-py3-none-any.whl
Keywords: optimization
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
cvxpyCVXPY is a Python modeling language for…
permissive · top 5,000 on PyPI
gekkoGEKKO is a Python package for optimization and…
permissive · top 15,000 on PyPI
cvxoptcvxopt is a Python library for solving convex…
unclear · top 5,000 on PyPI
optlangOptlang formulates and solves linear,…
permissive · top 15,000 on PyPI
cobraCOBRApy is a constraint-based modeling package…
copyleft · top 15,000 on PyPI
mipPython MIP models and solves mixed-integer…
copyleft · top 15,000 on PyPI
docplexModeling library for building and solving…
permissive · top 15,000 on PyPI
xpressPython interface to the FICO Xpress Optimizer…
unclear · top 15,000 on PyPI
ortoolsOR-Tools provides constraint programming,…
permissive · top 5,000 on PyPI
aimmspyaimmspy provides Python bindings to run AIMMS…
permissive · top 15,000 on PyPI