skillfed

deap

Distributed Evolutionary Algorithms in Python

deap v1.4.4 500.4K downloads/30d#6,321 on PyPI
Copyleft license LGPL Active released

What it is and what it does

DEAP is a framework for building evolutionary algorithms in Python. It provides building blocks for genetic algorithms, genetic programming, evolution strategies (including CMA-ES), and multi-objective optimization (NSGA-II, NSGA-III, SPEA2, MO-CMA-ES). The framework emphasizes making algorithms explicit and data structures transparent, allowing you to work with any representation—lists, arrays, sets, dictionaries, trees, or numpy arrays. It integrates with numpy and moocore for numerical operations and multi-objective tasks.

The package is designed for rapid prototyping and testing of evolutionary ideas. It includes utilities like a Hall of Fame for tracking the best individuals, checkpoints for system snapshots, benchmarks with common test functions, and genealogy tracking compatible with NetworkX. DEAP supports parallelization of fitness evaluations through mechanisms like multiprocessing and SCOOP, making it suitable for computationally intensive optimization problems.

Use it for:

  • Implement a genetic algorithm to optimize parameters for a machine learning model or engineering design
  • Solve multi-objective optimization problems where multiple competing objectives must be balanced
  • Develop genetic programming solutions to evolve symbolic expressions or program trees for regression or classification
  • Run evolution strategies like CMA-ES for continuous optimization of high-dimensional problems
  • Prototype particle swarm optimization or differential evolution algorithms for comparison studies

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

DEAP is an evolutionary computation framework for implementing genetic algorithms, genetic programming, evolution strategies, and multi-objective optimization with support for arbitrary data structures and parallelization.

Yes. DEAP is actively maintained, has low install friction, carries no known vulnerabilities, and is widely used in research and industry for evolutionary computation. The LGPL license is standard for research software and poses no barrier for most use cases. Install it if you need a mature, flexible framework for genetic algorithms, genetic programming, or multi-objective optimization.

Install

deap on PyPI

pip

pip install deap

uv

uv add deap

poetry

poetry add deap

Installing deap

Before you install

Low install friction with a pure-Python wheel distribution. Actively maintained with a release within the last 119 days. Depends on numpy and moocore, both widely available.

License in practice

DEAP is licensed under LGPL (copyleft), which requires that derivative works and modifications remain under the same license, though linking from proprietary code is permitted under the library exception.

Quickstart

pip install deap

from deap import creator, base, tools, algorithms
import random

creator.create("FitnessMax", base.Fitness, weights=(1.0,))
creator.create("Individual", list, fitness=creator.FitnessMax)
toolbox = base.Toolbox()
toolbox.register("attr_bool", random.randint, 0, 1)
toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool, n=100)
population = toolbox.population(n=300)

Verify before relying

  • Whether moocore is a required runtime dependency or only needed for specific multi-objective optimization features
  • Current Python version support range (requires_python not specified in metadata)

Package facts

License LGPL (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — numpy, moocore
Maintenance actively maintained — 119 days since the last release
First released
Downloads 500,364/month — #6,321 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: deap-1.4.4-py3-none-any.whl

Keywords: evolutionary algorithms, genetic algorithms, genetic programming, cma-es, ga, gp, es, pso

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Programming Language :: PythonProgramming Language :: Python :: 3Topic :: Scientific/EngineeringTopic :: Software Development

Tags

genetic algorithm frameworkevolutionary computation pythongenetic programming librarymulti-objective optimizationcma-es implementationparticle swarm optimizationdifferential evolution
optimizationevolutionary-algorithmsparallelizable

More Software Development packages

Further reading