Install & Compatibility
Where this runs
tested against v3.3.2 · 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
py 3.10
✕ build_error
4/8 runs
py 3.11
✕ build_error
4/8 runs
py 3.12
✕ build_error
4/8 runs
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
4/8 runs
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
get_data
✓ from pycaret.datasets import get_data
✗ from pycaret.datasets import get_data
This quickstart demonstrates a typical PyCaret classification workflow using the functional API. It involves loading a dataset, initializing the environment with `setup()`, comparing multiple models with `compare_models()`, making predictions, and saving the best performing model. [1, 7, 10, 11]
import pandas as pd
from pycaret.datasets import get_data
from pycaret.classification import *
# Load a sample dataset
data = get_data('diabetes')
# Initialize the setup (classification experiment)
# Use silent=True for non-interactive environments and session_id for reproducibility
clf1 = setup(data=data, target='Class variable', session_id=123, silent=True)
# Compare all available models and select the best one
best_model = compare_models()
# Make predictions on the hold-out set
predictions = predict_model(best_model)
# Save the trained model pipeline
save_model(best_model, 'diabetes_best_pipeline')
Debug
Known issues
breakingPyCaret 3.0 introduced significant API changes, making code written for PyCaret 2.x largely incompatible without modifications. [4, 9]fixRefer to the PyCaret 3.x documentation and tutorials for updated API usage. Consider rewriting or adapting existing PyCaret 2.x code.
affects: >=3.0.0
breakingPython 3.7 support was dropped in PyCaret 3.1.0, and Python 3.8 support was dropped in PyCaret 3.3.0. [4]fixEnsure your Python environment is running Python 3.9 or newer.
affects: >=3.1.0 (for Python 3.7), >=3.3.0 (for Python 3.8)
breakingThe `deep_check` and `eda` functions were removed in PyCaret 3.1.0 and will raise exceptions if called. [4]fixRemove calls to `deep_check()` and `eda()`. Use alternative data exploration or preprocessing methods if needed.
affects: >=3.1.0
gotchaThe `setup()` function is interactive by default, prompting the user for data type confirmation. This can halt execution in non-interactive environments. [1, 10]fixFor automated scripts, pass `silent=True` to suppress prompts. Always include `session_id` for reproducibility, e.g., `setup(data=data, target='target_col', session_id=123, silent=True)`.
affects: All versions
gotchaPyCaret 3.x has had specific dependency version constraints. For instance, PyCaret 3.0.4 pinned `scikit-learn<1.3.0` and 3.0.1 pinned `numpy<1.24`. While newer PyCaret 3.x versions (e.g., 3.3.0) support `scikit-learn 1.4` and `pandas 2.0`, users might encounter conflicts if not using the latest compatible PyCaret version. [4, 9]fixAlways install PyCaret in a clean virtual environment. Consult the official documentation for specific dependency requirements for your PyCaret version, or upgrade to the latest PyCaret to benefit from broader dependency support.
affects: Various 3.x versions
gotchaThe behavior and results of `compare_models()` might have changed significantly between PyCaret 3.0.0 and versions >= 3.0.1 due to internal bug fixes affecting model performance evaluation. [18]fixIf upgrading from 3.0.0, re-evaluate model performance and selection as results may differ. The changes were intended to be bug fixes, leading to more accurate evaluations in later versions.
affects: 3.0.1 - 3.x.x (compared to 3.0.0)
Upgrade
Version history
3.3.2latest on PyPI · released Apr 28, 2024
Audit
Dependencies
pythonrequiredRequires Python 3.9 or later.