pycharm集成环境中关于安装sklearn库报错问题分析及解决

在输入pip install sklearn后,出现如下提示:

python 复制代码
pip install sklearn

Collecting sklearn Using cached sklearn-0.0.post12.tar.gz (2.6 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully.

│ exit code: 1 ╰─> [15 lines of output] The 'sklearn' PyPI package is deprecated, use 'scikit-learn' rather than 'sklearn' for pip commands. Here is how to fix this error in the main use cases: - use 'pip install scikit-learn' rather than 'pip install sklearn' - replace 'sklearn' by 'scikit-learn' in your pip requirements files (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...) - if the 'sklearn' package is used by one of your dependencies, it would be great if you take some time to track which package uses 'sklearn' instead of 'scikit-learn' and report it to their issue tracker - as a last resort, set the environment variable SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error More information is available at https://github.com/scikit-learn/sklearn-pypi-package [end of output]

在翻译原文后,得出:

收集 sklearn

正在使用缓存的 sklearn-0.0.post12.tar.gz (2.6 kB)

正在安装构建依赖项... 完成

获取构建轮子的需求... 出错

错误:子进程退出并出现错误

× 获取构建轮子的需求未成功运行。

│ 退出代码:1

╰─> [15 行输出]

PyPI 上的 'sklearn' 包已被弃用,请使用 'scikit-learn'

而不是 'sklearn' 来执行 pip 命令。

便使用如下代码继续尝试:

python 复制代码
pip install scikit-learn

结束!!!

相关推荐
mcusun20004 小时前
VScode 使用Deepseek又方便又好用的另一款插件
ide·vscode·编辑器·deepseek
阿尔法波5 小时前
python与pycharm如何设置文件夹为源代码根目录
开发语言·python·pycharm
HealthScience7 小时前
【异常错误】pycharm debug view变量的时候显示不全,中间会以...显示
ide·python·pycharm
Stara05117 小时前
AI赋能编程:PyCharm与DeepSeek的智能开发革命
pycharm·ai编程·python3.9·deepseek
爱吃南瓜的北瓜8 小时前
Maven之jjwt依赖爆红
java·pycharm·maven
亲持红叶9 小时前
sklearn中的决策树-分类树:重要参数
决策树·分类·sklearn
waicsdn_haha10 小时前
Visual Studio Code 2025 安装与高效配置教程
c语言·ide·windows·vscode·微软·编辑器·win7
树欲静而风不止慢一点吧15 小时前
Visual Studio 2022配置网址参考
ide·visual studio
佚明zj15 小时前
libxls库的编译以及基于Visual studio的配置
ide·visual studio
AnalogElectronic16 小时前
问题记录,在使用android studio 构建项目时遇到的问题
android·ide·android studio