参考官网安装教程:
https://xgboost.readthedocs.io/en/latest/build.html
1 下载whl文件,下载地址为https://s3-us-west-2.amazonaws.com/xgboost-nightly-builds/list.html
下载命令:
wget https://files.pythonhosted.org/packages/7c/32/a11befbb003e0e6b7e062a77f010dfcec0ec3589be537b02d2eb2ff93b9a/xgboost-1.1.1-py3-none-manylinux2010_x86_64.whl
2 安装
pip install xgboost-1.1.1-py3-none-manylinux2010_x86_64.whl
报错:**.whl is not a supported wheel on this platform.
3 尝试另一种压缩包安装方式
下载命令:
wget https://files.pythonhosted.org/packages/aa/08/779aaa15de09590fad94cf533e3cc94b967d71b0daddaa2180685712be28/xgboost-1.1.1.tar.gz
解压命令:
tar -zxvf xgboost-1.1.1.tar.gz
安装命令:
pip install setup.py
出现报错:
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none)
ERROR: No matching distribution found for setup.py
4 最后重新尝试whl安装的命令
pip install xgboost-1.1.1-py3-none-manylinux2010_x86_64.whl
安装成功! 猜测压缩包安装的时候,虽然最终安装失败了,中间可能帮安装了一些必要的依赖环境
最后一点:因为我的Python环境是3.5.2,所以安装的较老的xgboost。如果是Python3.6以上,可以下载安装较新的whl