docplex
The IBM Decision Optimization CPLEX Modeling for Python
Decision gist · record as of 2026-08-14
Yes, with conditions. Install docplex if you have IBM ILOG CPLEX Optimization Studio already deployed or can obtain it, and you need to model optimization problems in Python. The library is actively maintained, permissively licensed, and well-integrated with Python data tools. Without CPLEX Studio installed separately, the package alone cannot solve models—it is a modeling layer only. The high install friction reflects this external dependency, not the package quality.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- IBM ILOG CPLEX Optimization Studio V12.8 or later must be installed on your machine to solve models; the package alone only provides modeling capabilities.
- High install friction: the package itself is straightforward, but solving models requires IBM ILOG CPLEX Optimization Studio V12.8 or later to be installed separately on your machine.
- Maintenance is active with recent releases.
License · maintenance · safety
Apache 2.0 (permissive) — Apache 2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects that can meet the external CPLEX solver dependency.
last release 2026-04-01 (135 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 78,447 downloads/mo, #14,442 on PyPI
Alternatives
Verify before relying
pip install docplex
from docplex.mp.model import Model
mdl = Model(name='example')
x = mdl.continuous_var(name='x')
y = mdl.continuous_var(name='y')
mdl.maximize(x + y)
mdl.add_constraint(x + y <= 10)
solution = mdl.solve()- Whether numpy 2.0 compatibility mentioned in changelog applies to current version 2.32.264
- Specific Python version support (requires_python is unspecified in metadata)
- Whether OPL model support in 2.32.264 requires additional CPLEX Studio features or configuration
What it is and what it does
Docplex is IBM's Python modeling library for building optimization problems that can be solved by IBM ILOG CPLEX Optimization Studio. It provides two main modules: docplex.mp for linear and quadratic programming, and docplex.cp for constraint programming. The library lets you define decision variables, constraints, and objectives in Python, then submit them to a CPLEX solver for execution.
The package is designed for developers who need to add optimization capabilities to applications—scheduling, resource allocation, planning, or other decision-making problems. It requires only six as a runtime dependency but mandates that CPLEX Optimization Studio be installed separately on your system to actually solve models. Recent versions add support for running OPL models directly from Python and work with modern Python versions including 3.13 and 3.14.
Use it for
- Build linear and quadratic programming models in Python and solve them with CPLEX without writing solver-specific syntax
- Embed constraint programming problems into Python applications for scheduling, sequencing, or resource optimization tasks
- Run OPL (Optimization Programming Language) models from Python using native integration instead of external .dat files
- Extract and process optimization results (variables, objectives, solution pools) in Python-friendly formats like dictionaries and pandas DataFrames
- Develop end-to-end optimization pipelines that combine data preparation, model building, solving, and result analysis in a single Python workflow
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install docplex if you have IBM ILOG CPLEX Optimization Studio already deployed or can obtain it, and you need to model optimization problems in Python. The library is actively maintained, permissively licensed, and well-integrated with Python data tools. Without CPLEX Studio installed separately, the package alone cannot solve models—it is a modeling layer only. The high install friction reflects this external dependency, not the package quality.
Install
docplex on PyPI
Before you install
High install friction: the package itself is straightforward, but solving models requires IBM ILOG CPLEX Optimization Studio V12.8 or later to be installed separately on your machine. Maintenance is active with recent releases.
IBM ILOG CPLEX Optimization Studio V12.8 or later must be installed on your machine to solve models; the package alone only provides modeling capabilities.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects that can meet the external CPLEX solver dependency.
Quickstart
pip install docplex
from docplex.mp.model import Model
mdl = Model(name='example')
x = mdl.continuous_var(name='x')
y = mdl.continuous_var(name='y')
mdl.maximize(x + y)
mdl.add_constraint(x + y <= 10)
solution = mdl.solve()
Verify before relying
- Whether numpy 2.0 compatibility mentioned in changelog applies to current version 2.32.264
- Specific Python version support (requires_python is unspecified in metadata)
- Whether OPL model support in 2.32.264 requires additional CPLEX Studio features or configuration
Package facts
| License | Apache 2.0 permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | 1 packagesix |
| Maintenance | Actively maintained 135 days since the last release |
| First released | |
| Downloads | 78,447 / month, #14,442 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: MicrosoftOperating System :: OS IndependentOperating System :: UnixProgramming Language :: Python :: 3Topic :: Other/Nonlisted TopicTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: LibrariesTopic :: System |
Evidence: docplex-2.32.264.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ibm decision optimization”
- docplexModeling library for building and solving mathematical optimization…
- qiskit-ibm-runtimeProvides a Python client to access IBM Quantum Compute (formerly…
- cplexProvides a Python interface to IBM CPLEX's optimization solver,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also cplex · optlang · PuLP · pyomo · mip · xpress · nlopt · cvxpy · xpresslibs · aimmspy