Skip to main content

⚠️⚠️⚠️ Summary ⚠️⚠️⚠️

⚠️⚠️⚠️ The sklearn PyPI package is deprecated use scikit-learn instead ⚠️⚠️⚠️

How to fix the error for the main use cases

  • use pip install scikit-learn rather than pip install sklearn
  • replace sklearn by scikit-learn in your pip requirements files (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
  • if the sklearn package is used by one of your dependencies it would be great if you take some time to track which package uses sklearn instead of scikit-learn and report it to their issue tracker
  • as a last resort, set the environment variable SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error

Brownout schedule

The following table shows the dates and time windows, where an exception will be raised if you attempt to install the sklearn package from PyPI.

Dates Window(s)
2022 December 1st - 2023 January 31st :00-:05 every hour
2023 February 1st - March 31st :00-:10 every hour
2023 April 1st - May 31st :00-:15 every hour
2023 June 1st - July 31st :00-:10 and :30-:40 every hour
2023 August 1st - September 30th :00-:15 and :30-:45 every hour
2023 October 1st - November 30th :00-:20 and :30-:50 every hour
2023 December 1st onwards always raise an exception

How to test whether a package will be affected by the sklearn deprecation

If you want to test whether a package has sklearn in its dependencies independently of the brownout schedule, you can do:

SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=False \
    pip install package-to-test-goes-here

If you get an error that means that the package has sklearn in one of its dependencies. It would be greatly appreciated if you track which package it is, and if you report it to the appropriate project issue tracker to make them aware of the sklearn deprecation.

Reason for the deprecation

sklearn package on PyPI exists to prevent malicious actors from using the sklearn package, since sklearn (the import name) and scikit-learn (the project name) are sometimes used interchangeably. scikit-learn is the actual package name and should be used with pip, e.g. for:

  • pip commands: pip install scikit-learn
  • pip requirement files (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)

At the time of writing (October 2022) sklearn downloads is about 1/5 of the scikit-learn downloads on PyPI so a lot of people are using it.

There are some edge cases with the way the PyPI sklearn package is implemented:

  • pip install sklearn==1.1.3 will say that the 1.1.3 version does not exist, which is confusing. The only available version at the time of writing of sklearn is 0.0.
  • pip uninstall sklearn will actually not uninstall scikit-learn, you can still do import sklearn afterwards
  • it can be confusing to have both sklearn and scikit-learn in the pip list output, prompting questions like "why do I have scikit-learn 1.1.3 and sklearn 0.0, and what does it even mean"?

Metadata

Release files for sklearn 0.0.post11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sklearn 0.0.post11
File Size Uploaded Provenance Actions
sklearn-0.0.post11.tar.gz 3.6 kB Without provenance Details for sklearn-0.0.post11.tar.gz

Release files / sklearn-0.0.post11.tar.gz

Download URL sklearn-0.0.post11.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
af035c4f0b970b7fc2d3856079aa1aa1032df3d7f65048a9d87114abf13c4629
BLAKE2b-256 checksum
How to use checksums
a40bd1c703256cf293be77b7db44dbef62251fe02a97d0bef981f7120b0b0c0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for sklearn 0.0.post11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.post11 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page