问题背景
最近在使用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