Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'sklearn' PyPI package is Deprecated #35

Closed
Mustaq-Ahmed16 opened this issue Jan 4, 2024 · 1 comment
Closed

The 'sklearn' PyPI package is Deprecated #35

Mustaq-Ahmed16 opened this issue Jan 4, 2024 · 1 comment

Comments

@Mustaq-Ahmed16
Copy link

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
If the previous advice does not cover your use case, feel free to open an issue about it.

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"?

@adrinjalali
Copy link
Member

And that's why we have deprecated sklearn on pypi.

@adrinjalali adrinjalali closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants