0

I have installed sklearn library using pip install sklearn but while importing it it shows there is no any library called sklearn that is it gives import error and afterwars i checked again installing using same command mentioned above but it says requirement already satisfied. Why it showing like this? What may be the solution for it? Here is the problem screenshot while importing

It's in CMD

C:\Users\scann>pip install sklearn Requirement already satisfied: sklearn in c:\users\scann\appdata\local\programs\python\python310\lib\site-packages (0.0.post1)

C:\Users\scann>pip install -U sklearn Requirement already satisfied: sklearn in c:\users\scann\appdata\local\programs\python\python310\lib\site-packages (0.0.post1)

I tried many methods for installation using github and using -U But also i Didn't find any correct solution

  • Can you please [read about why text is better than images of text](//meta.stackoverflow.com/a/285557/11107541) and then [edit] to add transcriptions of your images of text into actual text? See [/editing-help](/editing-help#code) for how to format code blocks. – starball Jan 09 '23 at 17:30
  • 1
    Does this answer your question? [ModuleNotFoundError: No module named 'sklearn'](https://stackoverflow.com/questions/46113732/modulenotfounderror-no-module-named-sklearn) – Karl Knechtel Jan 11 '23 at 23:39

1 Answers1

1

As of today (2023-01-09), pip install sklearn is in a "brownout" period, and installing this way will eventually be removed.

The preferred installation method is:

pip install scikit-learn

The reason for deprecation is listed as:

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.

Further reading:

Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34