当前位置:   article > 正文

python3.9安装sklearn

python3.9安装sklearn

python3.9安装sklearn

前言

本次安装是在Anaconda的虚拟环境下进行

首先打开Anaconda Prompt (Anaconda),输入以下命令激活自己创建的虚拟环境DL

conda activate DL
  • 1

查看python包安装情况,查看是否已经安装scikit-learn

pip list
  • 1

或者直接查看

pip show scikit-learn
  • 1

若显示WARNING: Package(s) not found: scikit-learn,则未安装

安装步骤

step1 下载whl

https://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn
  • 1

选择这个最新版本

scikit_learn‑1.1.1‑cp39‑cp39‑win_amd64.whl
  • 1

step2 手动安装

pip install ‘scikit_learn‑1.1.1‑cp39‑cp39‑win_amd64.whl存放的位置’
  • 1

比如我存放在如下

(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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

安装成功

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:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

安装无误

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/485296
推荐阅读
相关标签
  

闽ICP备14008679号