nlopt
Library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization
Decision gist · record as of 2026-08-14
Yes. NLopt is actively maintained, carries no known vulnerabilities, uses a permissive MIT license, and provides precompiled wheels that install cleanly on standard platforms. It is a stable, production-grade library for non-linear optimization with a straightforward API. Install it if you need to solve optimization problems beyond the scope of scipy.optimize or other general-purpose solvers.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; compiled wheels available for common platforms but may require build tools on unsupported architectures.
- Medium install friction due to compiled C++ bindings, but wheels are provided for Python 3.9+ across Windows, macOS, and Linux.
- Last release was 28 days ago with active repository maintenance.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns.
last release 2026-07-17 (28 days) · last repo commit 2026-08-11 · 33 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,083,574 downloads/mo, #4,392 on PyPI
Alternatives
Verify before relying
pip install nlopt
import nlopt
import numpy as np
opt = nlopt.opt(nlopt.LN_COBYLA, 2)
opt.set_min_objective(lambda x, grad: x[0]**2 + x[1]**2)
opt.optimize([1.0, 1.0])- Specific algorithm count and performance characteristics compared to other optimization libraries
- Whether the package includes derivative-free and gradient-based methods or only a subset
- Support for multi-objective optimization or only single-objective problems
What it is and what it does
NLopt is a Python wrapper around the NLopt C library, providing access to a collection of non-linear optimization algorithms. It handles both constrained and unconstrained problems, with support for global and local search methods. The package depends only on numpy and is distributed as pre-compiled wheels for modern Python versions on Windows, macOS, and Linux.
Developers use NLopt when they need to solve optimization problems that don't fit standard linear or convex frameworks—fitting parameters to data, tuning hyperparameters, or finding optimal configurations subject to constraints. The library abstracts away algorithm selection and convergence details, allowing you to specify an objective function and let NLopt handle the numerical work.
Use it for
- Fit model parameters to experimental data by minimizing the difference between predictions and observations
- Tune hyperparameters in machine learning or simulation models subject to bounds and constraints
- Solve engineering design problems where you need to optimize multiple objectives or handle non-convex search spaces
- Find equilibrium points or optimal configurations in physical systems with complex constraint relationships
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
NLopt is actively maintained, carries no known vulnerabilities, uses a permissive MIT license, and provides precompiled wheels that install cleanly on standard platforms. It is a stable, production-grade library for non-linear optimization with a straightforward API. Install it if you need to solve optimization problems beyond the scope of scipy.optimize or other general-purpose solvers.
Install
nlopt on PyPI
Before you install
Medium install friction due to compiled C++ bindings, but wheels are provided for Python 3.9+ across Windows, macOS, and Linux. Last release was 28 days ago with active repository maintenance.
Requires Python 3.9 or later; compiled wheels available for common platforms but may require build tools on unsupported architectures.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns.
Quickstart
pip install nlopt
import nlopt
import numpy as np
opt = nlopt.opt(nlopt.LN_COBYLA, 2)
opt.set_min_objective(lambda x, grad: x[0]**2 + x[1]**2)
opt.optimize([1.0, 1.0])
Verify before relying
- Specific algorithm count and performance characteristics compared to other optimization libraries
- Whether the package includes derivative-free and gradient-based methods or only a subset
- Support for multi-objective optimization or only single-objective problems
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,083,574 / month, #4,392 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 :: EducationIntended Audience :: End Users/DesktopLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: C++Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/Engineering |
Evidence: nlopt-2.11.0-cp310-cp310-macosx_11_0_arm64.whl; nlopt-2.11.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; nlopt-2.11.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; nlopt-2.11.0-cp310-cp310-win_amd64.whl; nlopt-2.11.0-cp311-cp311-macosx_11_0_arm64.whl; nlopt-2.11.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; nlopt-2.11.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; nlopt-2.11.0-cp311-cp311-win_amd64.whl; nlopt-2.11.0-cp312-cp312-macosx_11_0_arm64.whl; nlopt-2.11.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; nlopt-2.11.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; nlopt-2.11.0-cp312-cp312-win_amd64.whl; nlopt-2.11.0-cp313-cp313-macosx_11_0_arm64.whl; nlopt-2.11.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; nlopt-2.11.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; nlopt-2.11.0-cp313-cp313-win_amd64.whl; nlopt-2.11.0-cp314-cp314-macosx_11_0_arm64.whl; nlopt-2.11.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; nlopt-2.11.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; nlopt-2.11.0-cp314-cp314-win_amd64.whl
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 › “non-linear optimization”
- nloptNLopt provides Python bindings to the NLopt library, offering a suite…
- lmfitLmfit provides non-linear least-squares minimization and curve…
- ropwrRoPWR computes optimal piecewise polynomial regression with support…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also cvxopt · lmfit · swiglpk · optlang · quadprog · docplex · pyomo · directsearch · osqp · optbinning