ERROR: Failed building wheel for scikit-learn

I noticed the following line in the log, even though I am not using any of these packages.

Building wheels for collected packages: cufflinks, databricks-cli, future, gensim, htmlmin, pyLDAvis, pynndescent, pyod, scikit-learn, sklearn, umap-learn, validators

Much of the error messages were related to scikit-learn:

  Building wheel for scikit-learn (pyproject.toml): started
  Building wheel for scikit-learn (pyproject.toml): finished with status 'error'
Failed to build scikit-learn
ERROR: Could not build wheels for scikit-learn, which is required to install pyproject.toml-based projects

I managed to deploy an earlier commit successfully without any mention of ‘wheels’ in the log.
Please advise. Thank you.

My repo:

My app:

Hi @Teo, and welcome to our forums! :wave:

The version you’ve specified for scikit-learn is 0.23.2. It’s possible that there’s an issue with this specific version in the environment you’re deploying to.

Have you tried to update scikit-learn to the latest/a more recent version?


1 Like

scikit-learn==0.23.2 was released more than three years ago and there are binary packages available for python 3.6, 3.7 and 3.8. Redeploy using a compatible python or consider upgrading to more recent packages.


Thanks for the help. Updating scikit-learn fixed the earlier issue.

Currently when I try to do modelling (using train.csv) in the app, it appears that Pycaret is not working, giving a lot of error messages.

Also, is there a way to run pip freeze in steamlit? I would like to verify the package versions being used.

You can run pip this way:

import subprocess
import sys[sys.executable, "-m", "pip", "freeze"])

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.