问题背景
最近在使用jupyter notebook中使用scikit-learn模块时出现错误,经过在StackOver Flow上查询发现应该是scipy、scikit-lern和numpy的版本不匹配导致的,但是在anaconda prompt中尝试升级scikit-learn的版本:
命令:
pip install --upgrade scikit-learn
出现了以下错误:
*ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'd:\\program\\anaconda3\\envs\\ai\\Lib\\site-packages\\numpy\\.libs\\libopenblas.PYQHXLVVQ7VESDPUVUADXEVJOBGHJPAY.gfortran-win_amd64.dll'
Consider using the `--user` option or check the permissions.*

解决方法
添加–user参数,使用如下命令:
pip install --user --upgrade --ignore-installed scikit-learn
清华源:
pip install --user --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed scikit-learn
本文介绍在Anaconda环境下,由于版本不匹配导致scikit-learn使用错误的解决方案。通过添加--user参数并使用清华源,成功升级scikit-learn,解决了jupyternotebook中scikit-learn模块的问题。

4430

被折叠的 条评论
为什么被折叠?



