ERROR: Failed building wheel for scikit-learn

Hi:
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:
https://autopycaret.streamlit.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?

Thanks,
Charly

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.

2 Likes

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

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