python3.9安装sklearn
前言
本次安装是在Anaconda的虚拟环境下进行
首先打开Anaconda Prompt (Anaconda),输入以下命令激活自己创建的虚拟环境DL
conda activate DL
查看python包安装情况,查看是否已经安装scikit-learn
pip list
或者直接查看
pip show scikit-learn
若显示WARNING: Package(s) not found: scikit-learn
,则未安装
安装步骤
step1 下载whl
https://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn
选择这个最新版本
scikit_learn‑1.1.1‑cp39‑cp39‑win_amd64.whl
step2 手动安装
pip install ‘scikit_learn‑1.1.1‑cp39‑cp39‑win_amd64.whl存放的位置’
比如我存放在如下
(DL) C:\Users\re>pip install E:\whl\scikit_learn-1.1.1-cp39-cp39-win_amd64.whl
Processing e:\whl\scikit_learn-1.1.1-cp39-cp39-win_amd64.whl
Requirement already satisfied: numpy>=1.17.3 in e:\anaconda\envs\dl\lib\site-packages (from scikit-learn==1.1.1) (1.21.5)
Collecting scipy>=1.3.2 (from scikit-learn==1.1.1)
Downloading scipy-1.11.1-cp39-cp39-win_amd64.whl (44.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.1/44.1 MB 188.6 kB/s eta 0:00:00
Collecting joblib>=1.0.0 (from scikit-learn==1.1.1)
Downloading joblib-1.3.1-py3-none-any.whl (301 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 302.0/302.0 kB 172.8 kB/s eta 0:00:00
Collecting threadpoolctl>=2.0.0 (from scikit-learn==1.1.1)
Downloading threadpoolctl-3.2.0-py3-none-any.whl (15 kB)
Collecting numpy>=1.17.3 (from scikit-learn==1.1.1)
Downloading numpy-1.25.1-cp39-cp39-win_amd64.whl (15.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.1/15.1 MB 230.9 kB/s eta 0:00:00
Installing collected packages: threadpoolctl, numpy, joblib, scipy, scikit-learn
Attempting uninstall: numpy
Found existing installation: numpy 1.21.5
Uninstalling numpy-1.21.5:
Successfully uninstalled numpy-1.21.5
Successfully installed joblib-1.3.1 numpy-1.25.1 scikit-learn-1.1.1 scipy-1.11.1 threadpoolctl-3.2.0
安装成功
step3 检查
(DL) C:\Users\re>pip show scikit-learn
Name: scikit-learn
Version: 1.1.1
Summary: A set of python modules for machine learning and data mining
Home-page: http://scikit-learn.org
Author:
Author-email:
License: new BSD
Location: e:\anaconda\envs\dl\lib\site-packages
Requires: joblib, numpy, scipy, threadpoolctl
Required-by:
安装无误