PuLP
PuLP is an LP modeler written in python. PuLP can generate MPS or LP files and call GLPK, COIN CLP/CBC, CPLEX, and GUROBI to solve linear problems.
What it is and what it does
PuLP is a Python library for building and solving linear and mixed-integer programming optimization models. You define variables, constraints, and an objective function using a natural Python syntax, then call a solver to find the optimal solution. The library can generate standard MPS or LP file formats and integrates with a range of solvers, giving you flexibility in choosing the right solver for your problem scale and requirements.
PuLP is commonly used in operations research, supply chain optimization, scheduling, resource allocation, and other domains where you need to find the best solution subject to constraints. It has no runtime dependencies beyond Python itself, making it lightweight to install. However, to actually solve problems, you must install at least one solver separately, which may involve external system libraries or commercial licenses depending on your choice.
Use it for:
- Formulate and solve production scheduling problems with resource and time constraints
- Optimize supply chain logistics, warehouse allocation, or vehicle routing with cost minimization
- Solve resource allocation and portfolio optimization problems in finance or operations
- Model and solve knapsack, bin packing, or other combinatorial optimization problems
- Prototype optimization algorithms before moving to specialized software
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PuLP is a linear and mixed-integer programming modeler that lets you formulate optimization problems in Python and solve them using open-source or commercial solvers.
Yes, if you need to model and solve linear or mixed-integer optimization problems in Python. PuLP is actively maintained, has no install friction, and offers a clean Python API with broad solver support. Install it when you have an optimization problem to solve; be aware that you will need to install a solver separately.
Install
pulp on PyPI
pip
pip install pulpuv
uv add pulppoetry
poetry add pulpInstalling PuLP
Before you install
Installation is straightforward with no runtime dependencies; the package is a pure Python wheel. Maintenance is active with a recent release and steady repository activity.
License in practice
PuLP is distributed under the MIT license, a permissive open-source license that allows commercial and private use with minimal restrictions.
Quickstart
from pulp import LpProblem, LpMinimize, LpVariable
prob = LpProblem("myProblem", LpMinimize)
x = prob.add_variable("x", 0, 3)
y = prob.add_variable("y", cat="Binary")
prob += x + y <= 2
prob += -4*x + y
status = prob.solve()
Requires Python 3.10 or newer. A solver must be installed separately; without one, PuLP falls back to other available solvers.
Verify before relying
- Whether the fallback solver is suitable for production workloads or only for small problems
- Performance characteristics when solving large-scale problems with different solvers
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 81 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,037,804/month — #1,793 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pulp-3.3.2-py3-none-any.whl
Keywords: Optimization, Linear Programming, Operations Research
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
mipPython MIP models and solves mixed-integer…
copyleft · top 15,000 on PyPI
ortoolsOR-Tools provides constraint programming,…
permissive · top 5,000 on PyPI
linopylinopy builds linear, integer, and quadratic…
permissive · top 15,000 on PyPI
docplexModeling library for building and solving…
permissive · top 15,000 on PyPI
optlangOptlang formulates and solves linear,…
permissive · top 15,000 on PyPI
pulp-gluepulp-glue is a command-line interface for Pulp…
copyleft · top 15,000 on PyPI
amplpyamplpy is a Python interface to AMPL, an…
permissive · top 15,000 on PyPI
cylpCyLP provides a Python interface to COIN-OR's…
copyleft · top 15,000 on PyPI
swiglpkswiglpk provides direct Python bindings to the…
copyleft · top 15,000 on PyPI
pulp-cliA command-line interface for interacting with…
copyleft · top 15,000 on PyPI