Registry / ai-ml / pymoo
library0.6.1.6pypypiunverified

Pymoo is an open-source Python library for multi-objective optimization. It provides state-of-the-art single- and multi-objective optimization algorithms, along with features for visualization and decision-making. Currently at version 0.6.1.6, the library maintains an active development cadence with regular updates and bug fixes.

pip install -U pymoo
INSTALL
IMPORT
SIG · PYMOO
P
pymoo
ai-mlpythonv0.6.1.6
Install
17.9s avg
Import
1604ms
Disk
491MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.1.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.960 runs
installs and imports cleanly · install 0.0s · import 1.530s · 350.2MB
glibc
py 3.103.960 runs
installs and imports cleanly · install 17.9s · import 1.679s · 668MB
491MB installed
● package 491MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NSGA2
from pymoo.algorithms.moo.nsga2 import NSGA2
from pymoo.factory import get_algorithm
Module organization changed in 0.5.0; factory methods deprecated in 0.6.0.
get_problem
from pymoo.problems import get_problem
from pymoo.factory import get_problem
Factory methods deprecated in 0.6.0. Use direct import or problem definition classes.
minimize
from pymoo.optimize import minimize
Scatter
from pymoo.visualization.scatter import Scatter

This quickstart defines a custom constrained multi-objective optimization problem, initializes the NSGA-II algorithm, sets a termination criterion based on the number of generations, runs the optimization, and visualizes the resulting Pareto front. Note that custom problems should now inherit from `pymoo.core.problem.Problem` or `ElementwiseProblem`.

import numpy as np from pymoo.algorithms.moo.nsga2 import NSGA2 from pymoo.core.problem import Problem from pymoo.optimize import minimize from pymoo.visualization.scatter import Scatter # Define your custom problem as an object class MyProblem(Problem): def __init__(self): super().__init__(n_var=2, n_obj=2, n_constr=2, xl=np.array([-2.0, -2.0]), xu=np.array([2.0, 2.0])) def _evaluate(self, X, out, *args, **kwargs): f1 = X[:, 0]**2 + X[:, 1]**2 f2 = (X[:, 0]-1)**2 + X[:, 1]**2 g1 = 2 * (X[:, 0]-0.1) * (X[:, 0]-0.9) g2 = 20 * (X[:, 0]-0.4) * (X[:, 0]-0.6) out["F"] = np.column_stack([f1, f2]) out["G"] = np.column_stack([g1, g2]) # Instantiate the problem problem = MyProblem() # Choose an algorithm algorithm = NSGA2(pop_size=100) # Define the termination criterion termination = ('n_gen', 200) # Optimize res = minimize(problem, algorithm, termination, seed=1, verbose=False) # Plot the results plot = Scatter() plot.add(res.F, color="red") plot.show()
Debug
Known issues
breakingThe module organization was entirely changed in version 0.5.0. Many classes, especially algorithms, moved to nested submodules (e.g., `pymoo.algorithms.moo.nsga2.NSGA2`).
fix
Update import paths to reflect the new structure, e.g., `from pymoo.algorithms.moo.nsga2 import NSGA2` instead of `from pymoo.algorithms.nsga2 import NSGA2` (old paths are approximate).
affects: >=0.5.0
breakingFactory methods (`get_algorithm`, `get_problem`, `get_mutation`, etc.) were deprecated or deactivated in version 0.6.0 to improve clarity and reduce maintenance overhead.
fix
Directly import and instantiate classes (e.g., `NSGA2(pop_size=100)`) instead of using factory functions (e.g., `get_algorithm("nsga2", pop_size=100)`).
affects: >=0.6.0
breakingThe termination criterion interface changed in version 0.6.0. Custom termination objects now need to return a floating-point number (0 for continue, 1 for terminate) instead of a boolean.
fix
Adjust custom termination logic to return a float, or use tuple-based termination criteria (e.g., `('n_gen', 200)`).
affects: >=0.6.0
breakingVersions prior to 0.6.1.3 are incompatible with NumPy 2.0.0 due to changes in how `autograd` interacts with NumPy's internal structure.
fix
Upgrade `pymoo` to version 0.6.1.3 or newer, or downgrade `numpy` to a version less than 2.0.0 (e.g., `numpy<2`). `autograd` is now optional in `pymoo >= 0.6.1.3`.
affects: <0.6.1.3
gotchaPymoo offers three ways to define an optimization problem: `Problem` (vectorized evaluation), `ElementwiseProblem` (single-solution evaluation), and `FunctionalProblem` (using functions). Choosing the wrong type can impact performance and parallelization.
fix
Understand the differences and select the appropriate problem definition for your use case. `Problem` is generally preferred for population-based algorithms due to vectorized evaluation efficiency, while `ElementwiseProblem` simplifies custom parallelization.
affects: All
Upgrade
Version history
0.6.1.6latest on PyPI · released Nov 25, 2025
Audit
Dependencies
alive_progressrequiredProgress bar for optimization process
autogradrequiredAutomatic differentiation (can be optional since 0.6.1.3)
cmarequiredRequired for CMA-ES algorithm
deprecatedrequiredUtility for marking deprecated code
matplotlibrequiredFor visualization capabilities
moocorerequiredCore multi-objective optimization utilities
numpyrequiredFundamental package for numerical computing
scipyrequiredScientific computing tools
jobliboptionalFor parallelization features
daskoptionalFor parallelization features
rayoptionalFor parallelization features
optunaoptionalFor hyperparameter tuning features
Agent activity
41 hits · last 30 days
node
36
Amazon
1
OpenAI (training)
1
Resources