{"id":6424,"library":"pycaret","title":"PyCaret","description":"PyCaret is an open-source, low-code machine learning library in Python that streamlines end-to-end machine learning workflows, from data preparation to model deployment. It is currently at version 3.3.2 and maintains an active release schedule, frequently delivering minor updates for bug fixes and dependency compatibility, alongside significant major releases that introduce new features and breaking API changes. [1, 13, 14, 15]","status":"active","version":"3.3.2","language":"en","source_language":"en","source_url":"https://github.com/pycaret/pycaret","tags":["machine-learning","low-code","automl","data-science","classification","regression","time-series"],"install":[{"cmd":"pip install pycaret","lang":"bash","label":"Basic Installation"},{"cmd":"pip install pycaret[full]","lang":"bash","label":"Full Installation (includes all optional dependencies)"}],"dependencies":[{"reason":"Requires Python 3.9 or later.","package":"python","optional":false}],"imports":[{"symbol":"get_data","correct":"from pycaret.datasets import get_data"},{"note":"PyCaret's functional API requires importing specific modules (e.g., `classification`, `regression`) to access functions like `setup`.","wrong":"import pycaret; pycaret.setup()","symbol":"setup","correct":"from pycaret.classification import setup"},{"note":"For the object-oriented API introduced in PyCaret 3.x.","symbol":"ClassificationExperiment","correct":"from pycaret.classification import ClassificationExperiment"},{"symbol":"compare_models","correct":"from pycaret.classification import compare_models"},{"symbol":"predict_model","correct":"from pycaret.classification import predict_model"},{"symbol":"save_model","correct":"from pycaret.classification import save_model"}],"quickstart":{"code":"import pandas as pd\nfrom pycaret.datasets import get_data\nfrom pycaret.classification import *\n\n# Load a sample dataset\ndata = get_data('diabetes')\n\n# Initialize the setup (classification experiment)\n# Use silent=True for non-interactive environments and session_id for reproducibility\nclf1 = setup(data=data, target='Class variable', session_id=123, silent=True)\n\n# Compare all available models and select the best one\nbest_model = compare_models()\n\n# Make predictions on the hold-out set\npredictions = predict_model(best_model)\n\n# Save the trained model pipeline\nsave_model(best_model, 'diabetes_best_pipeline')","lang":"python","description":"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]"},"warnings":[{"fix":"Refer to the PyCaret 3.x documentation and tutorials for updated API usage. Consider rewriting or adapting existing PyCaret 2.x code.","message":"PyCaret 3.0 introduced significant API changes, making code written for PyCaret 2.x largely incompatible without modifications. [4, 9]","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure your Python environment is running Python 3.9 or newer.","message":"Python 3.7 support was dropped in PyCaret 3.1.0, and Python 3.8 support was dropped in PyCaret 3.3.0. [4]","severity":"breaking","affected_versions":">=3.1.0 (for Python 3.7), >=3.3.0 (for Python 3.8)"},{"fix":"Remove calls to `deep_check()` and `eda()`. Use alternative data exploration or preprocessing methods if needed.","message":"The `deep_check` and `eda` functions were removed in PyCaret 3.1.0 and will raise exceptions if called. [4]","severity":"breaking","affected_versions":">=3.1.0"},{"fix":"For 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)`.","message":"The `setup()` function is interactive by default, prompting the user for data type confirmation. This can halt execution in non-interactive environments. [1, 10]","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always 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.","message":"PyCaret 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]","severity":"gotcha","affected_versions":"Various 3.x versions"},{"fix":"If 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.","message":"The 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]","severity":"gotcha","affected_versions":"3.0.1 - 3.x.x (compared to 3.0.0)"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[{"fix":"Ensure your virtual environment is activated, then run: `pip install pycaret` (or `!pip install pycaret` in Jupyter/Colab notebooks).","cause":"The PyCaret library is not installed in your current Python environment, or the environment where it's installed is not active.","error":"ModuleNotFoundError: No module named 'pycaret'"},{"fix":"Verify that your Python version is compatible with PyCaret (e.g., 3.9, 3.10, or 3.11 for PyCaret 3.x). Then, try installing again: `pip install pycaret` or `pip install pycaret[full]` for all optional dependencies.","cause":"This error occurs when `pip` cannot find a compatible version of PyCaret to install, often due to an unsupported Python version or network issues preventing access to the PyPI repository.","error":"ERROR: Could not find a version that satisfies the requirement pycaret"},{"fix":"Downgrade your `scikit-learn` package to a version known to be compatible with your PyCaret installation, often `scikit-learn==0.23.2` or as specified by PyCaret's documentation. Example: `pip install scikit-learn==0.23.2 --force-reinstall`.","cause":"This specific AttributeError typically arises from an incompatibility between the installed version of PyCaret and its underlying `scikit-learn` dependency, where `scikit-learn`'s API has changed.","error":"AttributeError: 'Simple_Imputer' object has no attribute 'fill_value_categorical'"},{"fix":"Install PyCaret in a fresh virtual environment to isolate its dependencies. If issues persist, try `pip install pycaret[full]` to ensure all recommended dependencies are installed, or manually install `scikit-learn` and the conflicting package to mutually compatible versions as suggested by the error message or PyCaret's documentation.","cause":"This indicates a dependency conflict where one of PyCaret's internal or optional dependencies requires a different `scikit-learn` version than what PyCaret itself expects or installs, leading to version mismatches.","error":"ERROR: Some_Dependency has requirement scikit-learn>=X.Y, but you'll have scikit-learn A.B which is incompatible."}]}