Skip to content

Installation ​

Prerequisites ​

  • Python ≥ 3.12
  • pip or conda

The test matrix covers standard CPython 3.12–3.15 on Linux, macOS, and Windows. Free-threaded builds are not covered.

pip ​

Install the core package:

bash
pip install sklearn-genetic-opt

Install the runtime extras for optimization, plotting and MLflow:

bash
python -m pip install "sklearn-genetic-opt[all]"

Install individual extras:

bash
python -m pip install "sklearn-genetic-opt[plot]"      # seaborn for plot_fitness_evolution / plot_search_space
python -m pip install "sklearn-genetic-opt[mlflow]"    # MLflow 3 logging

Optimization backends ​

Install one engine and plotting together, or install all four extra engines:

bash
python -m pip install "sklearn-genetic-opt[pymoo,plot]>=0.16.0"
python -m pip install "sklearn-genetic-opt[scipy,nevergrad,cmaes,pymoo]>=0.16.0"

DEAP is included in the base package. The SciPy extra enforces the solver's minimum version even when scikit-learn can use an older SciPy. Some platforms may build pymoo from source. See the engine reference and run your first backend comparison.

conda ​

bash
conda install -c conda-forge sklearn-genetic-opt

The conda package ships only the core dependencies. Install optional extras alongside it:

bash
conda install -c conda-forge sklearn-genetic-opt seaborn mlflow

Requirements ​

PackageMinimum versionRequired
Python3.12Yes
scikit-learn1.5.0Yes
NumPy1.26.0Yes
pandas1.3.0Yes
DEAP1.4.4Yes
tqdm4.60.0Yes
SciPy1.15For the SciPy optimization backend
Nevergrad>=1.0.12, <2nevergrad extra
cmaes>=0.13.1, <0.14cmaes extra
pymoo>=0.6.2, <0.7pymoo extra
Seaborn0.13.2No (plots)
MLflow3.14.0No (MLflow logging)

On Python 3.15, pip requires scikit-learn ≥ 1.9.1, NumPy ≥ 2.5.2, pandas ≥ 3.0.6, and SciPy ≥ 1.18.1. These versions have upstream wheels for CPython 3.15. Update any older pins in your environment before installing; the general lower bounds above remain unchanged on older interpreters. Conda instead resolves compatible builds from its channels.

Verify the installation ​

python
import sklearn_genetic
print(sklearn_genetic.__version__)

Next Steps ​

  • Basic Usage — start here if you're new to the library.
  • When to Use — decide if GA search fits your problem.

Released under the MIT License.