Sklearn installation (brief tutorial)

1. Preparation

Python and windows10 system
Before installing sklearn, you need to install two libraries, namely numpy+mkl and scipy.

Two, scipy installation

In the same way as the normal library installation, pip installation is used here.

pip install -U scikit-learn --user

Three, numpy+mkl installation

Do not use pip3 to install directly on the terminal, because pip3 installs numpy by default, not numpy+mkl.
Use the method of manually downloading in the third-party library and then installing it.
Third-party library URL: https://www.lfd.uci.edu/~gohlke/pythonlibs/

3.1 Install the wheel package tool

python -m pip install --upgrade pip
pip3 install wheel

3.2 View the version supported by the installed python

Run this command in cmd or in Anaconda

pip debug --verbose

insert image description here

3.3 Download NumPy+mkl

Here, according to the specific situation of 3.2, open the third-party library URL and select the corresponding version to download.
insert image description here

3.4 Install NumPy+mkl

(1) Go to the folder of the specified download library in the command line D:\>cd D:\Program Files\桌面
(2) Locate the address of the previously downloaded Numpy+mkl in the folder, and then enter cmd or win+R to open the terminal

pip install numpy-1.22.4+mkl-cp39-cp39-win_amd64.whl --user

Four, Sklearn installation

pip install -U scikit-learn --user

Guess you like

Origin blog.csdn.net/Xingchen0101/article/details/126332660