用了网上很多方法,终于装上了,分享一下,希望大家不被环境困扰。
- 首先你的python版本必须是以下版本才能安装 xgboost 包(我先用的3.5版本)
这里建议使用3.6版本
conda create -n name python==3.6
- 然后登录 https://anaconda.org/search?q=xgboost
根据你的当前环境选择对应的conda语句进行安装
一般而言,我们选择你当前系统环境下,Favorites和Downloads最多的一个,因为越多人用,意味着越稳定 - 点进去后选择推荐的任一语句进行安装即可
conda install -c conda-forge xgboost
conda install -c conda-forge/label/gcc7 xgboost
conda install -c conda-forge/label/cf201901 xgboost
conda install -c conda-forge/label/cf202003 xgboost
PS:我直接用 第一条语句,第一次安装失败了,然后再安装一次就成功了,反正这些安装的语句是官方推荐的,多试几次就能成功,
其他anaconda环境下的包的安装有问题,直接同理就可以安装了
https://anaconda.org/search?q=你要安装的包名
例如
https://anaconda.org/search?q=numpy