skillfed

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.

pulp v3.3.2 7.0M downloads/30d#1,793 on PyPI2,465
Permissive license MIT Active released

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 pulp

uv

uv add pulp

poetry

poetry add pulp

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: Science/ResearchNatural Language :: EnglishProgramming Language :: PythonTopic :: Scientific/Engineering :: Mathematics

Tags

linear programming solvermixed integer programmingoptimization modelingMILP solver pythonconstraint optimizationoperations researchLP problem formulation
optimizationoperations-researchlinear-programming

More Mathematics packages