machine learning library for the Python programming language
scikit-learn (formerly scikits.learn and also known as sklearn) is a free and open-source machine learning library for the Python programming language. It features various classification, regression and clustering algorithms including support-vector machines, … Wikipedia
Factsheet
scikit-learn
Original author David Cournapeau
Developer Google Summer of Code project
Factsheet
scikit-learn
Original author David Cournapeau
Developer Google Summer of Code project
🌐
scikit-learn
scikit-learn.org › stable › install.html
Installing scikit-learn — scikit-learn 1.8.0 documentation
Note that the virtual environment is optional but strongly recommended, in order to avoid potential conflicts with other packages. python -m venv sklearn-env source sklearn-env/bin/activate # activate pip install -U scikit-learn
🌐
PyPI
pypi.org › project › scikit-learn
scikit-learn · PyPI
If you already have a working installation of NumPy and SciPy, the easiest way to install scikit-learn is using pip:
      » pip install scikit-learn
    
Published   Dec 10, 2025
Version   1.8.0
🌐
PyPI
pypi.org › project › sklearn
sklearn · PyPI
⚠️⚠️⚠️ The sklearn PyPI package is deprecated use scikit-learn instead ⚠️⚠️⚠️ · use pip install scikit-learn rather than pip install sklearn
      » pip install sklearn
    
Published   Dec 01, 2023
Version   0.0.post12
🌐
ActiveState
activestate.com › home › resources › quick read › how to install scikit-learn?
How to Install Scikit-Learn? - ActiveState
January 23, 2024 - Click to install or import Scikit-Learn, one of the most useful data analysis libraries in Python. Step by step installation guide.
🌐
scikit-learn
scikit-learn.org › 0.21 › install.html
Installing scikit-learn — scikit-learn 0.21.3 documentation
If you already have a working installation of numpy and scipy, the easiest way to install scikit-learn is using pip
🌐
Reddit
reddit.com › r/learnpython › question about installing scikit-learn using pip
r/learnpython on Reddit: Question about installing scikit-learn using pip
December 15, 2021 -

Just as a preface, I should say I'm a complete beginner that's only started learning python in the last few weeks.

I came across a question that wanted me to write a function that minimised the mean squared error/deviation for a list of integers.

I looked online about how to solve this and it seems both numpy and scikit-learn are 2 modules that can be used to solve this problem.

I then looked up how to install modules which instructed me to use the command prompt.

For numpy, I simply opened up the command prompt and typed in:

pip install numpy

That instruction was what I found on the numpy website and this seemed to work.

I then tried to install scikit-learn by typing in the following in the command prompt:

pip install -U scikit-learn

However, despite the fact that was the command prompt listed on the scikit website, there were a lot of issues (just a wall of red text after a minute or so) and tbh I just closed the command prompt in a panic.

From looking online, I read that typing in '-U' between 'install' and 'scikit...' was an error because the '-U' implies I already have scikit-learn installed and I just want to update it. Another fact that I found was that in order to install scikit-learn I first have to install scipy.

Can anyone tell me what I should do to install scikit-learn?

Having installed numpy already, is it enough to simply type in:

pip install scipy

Wait for that to install and then type in:

pip install scikit-learn

Any replies would be appreciated

Top answer
1 of 2
1
First things first - make sure you are using a virtual envronment, either through PIP or conda. https://duckduckgo.com/?q=why+use+a+virtual+environment+python Second, for beginnersm Anaconda is very helpful becuase it comes with all the popular packages including those you mentioned, pre-installed and ready to use out of the box. https://www.anaconda.com/products/individual If you do this you don't have to worry about a virtual environment i mentioned about, Anaconda does it for you. Main benefit, you won't have to worry about questions like the one posted this while you increase your skills and knowledge. BTW I almost guarantee critics will complain that it's bloated etc, but 1) that's the point, it's all included, you can easily uninstall when you are ready and 2) those people are mostly developers who don't apprecate that there are other use cases for python. Anaconda is widely used in academia and data science for the exact reasons i mentioned. To anwer your question if you want to do it yourself without Anaconda - do a virtual environment, activate it and then yes just type in pip install scikit-learn. You don't need to do pip install scipy. It is a formal dependency and will be automatically installed for you if you don't already have it, same with numpy.
2 of 2
1
Answering some stuff: -U (same as --upgrade) will upgrade the package if it is there, if not, it will install it from zero (so it's not a problem) Environments are recommended (so you can use different programs with different packages, without one interfering with each other, think of like each project having a separate house to work on) One of the dependencies of scikit-learn is scipy. You usually don't need to worry about it, because pip will automatically install scipy for you when it installs scikit-learn. I don't know what error happened with you. Can you paste the full thing that appeared (specially the red lines?). I assume it may be trying to compile something, so try running the following command: python -m pip install --upgrade pip setuptools wheel
Find elsewhere
🌐
scikit-learn
scikit-learn.org › 0.15 › install.html
Installing scikit-learn — scikit-learn 0.15-git documentation
nosetests -v sklearn/ This is automated by the commands: make in · and: make test · You can also install a symlink named site-packages/scikit-learn.egg-link to the development folder of scikit-learn with: pip install --editable . © 2010 - 2014, scikit-learn developers (BSD License).
🌐
GeeksforGeeks
geeksforgeeks.org › machine learning › how-to-install-scikit-learn-in-windows
How to Install Scikit-Learn in Windows? - GeeksforGeeks
July 23, 2025 - Users who prefer to use pip can use the pip install sklearn command as given below to install the Scikit-Learn library on Windows:
🌐
Python Central
pythoncentral.io › installing-scikit-learn-using-pip-a-beginners-guide
Installing Scikit Learn Using pip: A Beginner's Guide | Python Central
January 31, 2024 - In this guide, we will discuss the different methods of installing scikit-learn and walk you through the fastest and simplest installation method.
🌐
Medium
medium.com › @gremwang › we-pip-install-scikit-learn-but-we-import-sklearn-in-python-code-why-43c64b8eab2c
We ‘pip install scikit-learn’, but we ‘import sklearn’ in python code , why? | by G Wang | Medium
April 2, 2024 - The package name used in pip install is defined by the package's developers for the Python Package Index (PyPI) and does not have to strictly match the Python import statement. Here's why this happens in the case of Scikit-learn: Package Naming vs. Module Naming: The package name (scikit-learn) is chosen to be descriptive and adheres to PyPI naming conventions, while the module name (sklearn) is chosen for simplicity and ease of use in code.
🌐
PyPI
pypi.org › project › sklearn-model
sklearn-model · PyPI
pip3 install sklearn-model · Check out the following Jupyter notebooks in the examples directory. Linear Regression · KMeans · Decision Tree Classification · Please feel free to raise an issue in case of any query or send a pull request ...
      » pip install sklearn-model
    
Published   Apr 19, 2021
Version   0.0.6
🌐
MyScale
myscale.com › blog › install-scikit-learn-step-by-step-guide
How to Install Scikit-Learn: Step-by-Step Guide
April 24, 2024 - In the context of installing ... window) and conda is paramount. Pip, Python's package installer, simplifies the installation process by fetching and managing Python packages effortlessly....
🌐
Readthedocs
scikit-learn-extra.readthedocs.io › en › stable › install.html
Installation — scikit-learn-extra 0.3.0 documentation
Latest development version can be installed with, pip install https://github.com/scikit-learn-contrib/scikit-learn-extra/archive/master.zip
🌐
scikit-learn
scikit-learn.org › 0.17 › install.html
Installing scikit-learn — scikit-learn 0.17.1 documentation
If you already have a working installation of numpy and scipy, the easiest way to install scikit-learn is using pip
🌐
scikit-learn
ogrisel.github.io › scikit-learn.org › sklearn-tutorial › install.html
1. Installing scikit-learn — scikit-learn 0.11-git documentation
This is usually the fastest way to install the latest stable release. If you have pip or easy_install, you can install or update with the command:
🌐
scikit-learn
scikit-learn.org › 0.19 › install.html
Installing scikit-learn — scikit-learn 0.19.2 documentation
If you already have a working installation of numpy and scipy, the easiest way to install scikit-learn is using pip
🌐
Built In
builtin.com › articles › modulenotfounderror-no-module-named-sklearn
Fix ModuleNotFoundError: No Module Named 'Sklearn'
February 22, 2024 - Now, you can finally install sklearn, and any other dependency you need to build your Python application, using the commands we discussed earlier. (my_project_venv) $ python3 -m pip install scikit-learn
🌐
scikit-learn
scikit-learn.org › 0.16 › install.html
Installing scikit-learn — scikit-learn 0.16.1 documentation
The --user flag ask pip to install scikit-learn in the $HOME/.local folder therefore not requiring root permission. This flag should make pip ignore any old version of scikit-learn previously installed on the system while benefiting from system packages for numpy and scipy.