python3.9安装sklearn

本文介绍了如何在Python3.9的Anaconda虚拟环境下安装scikit-learn库。首先激活虚拟环境,然后通过访问特定网站下载whl文件,使用pip安装该文件。在安装过程中,如果未找到scikit-learn,则下载相应版本的whl文件并指定路径进行安装。安装完成后,通过`pipshowscikit-learn`确认安装成功。
摘要由CSDN通过智能技术生成

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:

安装无误

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
根据引用\[1\]和引用\[3\]的内容,对应于Python 3.9的OpenCV版本是opencv_python-4.5.5-cp39-cp39-win_amd64.whl。你可以从https://www.lfd.uci.edu/~gohlke/pythonlibs/下载并安装这个版本的OpenCV。 #### 引用[.reference_title] - *1* [关于python3.9版本在anaconda创建好的环境中安装opencv库、skimage库、sklearn库解决方法,同样适用于...](https://blog.csdn.net/Arican_/article/details/122994674)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [高版本(3.9版本)python在anaconda安装opencv库及skimage库(scikit_image库)诸多问题解决办法](https://blog.csdn.net/q923714892/article/details/117135871)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [最新openCV-Python安装教程(python:3.9||opencv-python:4.5.5)](https://blog.csdn.net/weixin_43349916/article/details/123232335)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值