--- id: nlopt version: "2.11.0" license: MIT license_treatment: permissive maintenance: active --- # nlopt — Library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization License: permissive · Maintenance: active · Downloads: 1.1M/mo ## 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 above — verify before relying. NLopt provides Python bindings to the NLopt library, offering a suite of algorithms for solving non-linear optimization problems with global, local, constrained, and unconstrained variants. 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 pip install nlopt uv add nlopt poetry add nlopt ## Installing nlopt 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. 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]) Requires Python 3.9 or later; compiled wheels available for common platforms but may require build tools on unsupported architectures. 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_current - Install friction: medium - Maintenance: active - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags non-linear optimization, constrained optimization algorithms, global local optimization, mathematical optimization library, optimization solver python, optimization, numerical-methods, scientific-computing [View on SkillFed](https://skillfed.io/packages/nlopt) · [View on PyPI](https://pypi.org/project/nlopt/)