AttributeError: 'super' object has no attribute '__sklearn_tags__'
scikit-learn 1.6 changed its internal tags API, and an older XGBoost or similar wrapper is incompatible with it. Upgrade the wrapper library, or pin scikit-learn below 1.6.
Updated
The error
AttributeError: 'super' object has no attribute '__sklearn_tags__'
It typically appears when fitting an XGBoost, LightGBM or other scikit-learn-compatible estimator, or when passing one into cross_val_score, GridSearchCV or a pipeline.
What it means
Libraries like XGBoost provide wrapper classes (XGBClassifier, XGBRegressor) that plug into scikit-learn's ecosystem. That plug-in contract includes an internal "tags" mechanism scikit-learn uses to ask estimators about their capabilities. scikit-learn 1.6 (December 2024) replaced the old tags mechanism with a new one, __sklearn_tags__. Wrappers written against the old contract crash when new scikit-learn calls the new method.
This is a pure version-compatibility clash: new scikit-learn, old wrapper.
Why it happens
You upgraded scikit-learn (or installed a fresh environment that pulled the latest) while an older XGBoost/LightGBM/other wrapper stayed pinned. The error fires only when scikit-learn machinery touches the estimator — plain model.fit(X, y) may work while cross_val_score(model, ...) fails, which makes it look random. It is not random; the CV path exercises the tags API.
How to fix it
1. Upgrade the wrapper library. For XGBoost, compatibility with scikit-learn 1.6 arrived in 2.1.4.
pip install -U xgboostFor LightGBM, CatBoost or another library showing this error, the same move applies — their current releases support the new API.
pip install -U lightgbm catboost2. Check what you have when unsure which side is old.
pip show scikit-learn xgboostscikit-learn at 1.6+ with xgboost below 2.1.4 is the broken pairing.
3. If you cannot upgrade the wrapper, pin scikit-learn below 1.6.
pip install "scikit-learn<1.6"This is the stopgap for frozen environments — record it in requirements.txt with a comment saying why, so someone removes the pin later.
How to prevent it
Upgrade companion libraries together: scikit-learn and everything that wraps it form one compatibility set. A requirements.txt with pinned, tested versions makes environments reproducible, and upgrading becomes a deliberate event instead of a surprise during pip install of something unrelated.
Related errors
- ResolutionImpossible: conflicting dependencies
- A module compiled using NumPy 1.x cannot be run in NumPy 2 — the same story at the binary level
- module 'numpy' has no attribute 'float'