win+R,输入cmd打开,
输入
pip install xgboost -i https://pypi.tuna.tsinghua.edu.cn/simple
即可
https://pypi.tuna.tsinghua.edu.cn/simple是清华镜像,下载下来很快,比自己下载xgboost再去ananconda目录里安装快多了
如果遇到了报错:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
或者
after connection broken by ‘ProxyError(‘Cannot connect to proxy.‘)
可能是因为使用了网络代理,把代理关掉即可。
如若继续报错,可能是pypi.tuna.tsinghua.edu.cn的存储库不是受信任的或安全的主机
输入以下代码解决问题:
pip install xgboost -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
成功截图: