Python2.7+Win10 安装Xgboost

本文记录了在Windows 10系统中,使用Python2.7版本安装Xgboost库的过程,包括安装GitBash、MinGW、Anconda2,配置环境变量,以及解决编译和找不到XGBoost库的问题。通过下载xgboost.dll并放置到指定目录,最终成功安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装了一个下午才装好,痛苦~~~~~

在此将方法分享给大家

(1)需要的软件:

GitBash / MinGW / Anconda2

(2)流程:

首先在Git Bash中依次输入

// Git 下载地址https://git-for-windows.github.io/ 

1.cd target_folder //GitHub源代码存放的地方

// 我是存放在 C:\User\xgboost,所以我是直接输入 cd xgboost

2.git clone --recursive https://github.com/dmlc/xgboost

3.安装MinGW

// MinGW 下载地址http://mingw-w64.org/doku.php 

4.将MinGW文件下的bin写进环境变量,我的路径是C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\bin

5.在Git中输入 

mingw32-make

Git返回>>>>>>>>>>>mingw32-make: *** No targets specified and no makefile found.  Stop.

说明安装和设置都成功了

6.继续在Git中依次键入以下命令

cd xgboost 
alias make=’mingw32-make’ 
cd dmlc-core 
make -j4 
cd ../rabit 
make lib/librabit_empty.a -j4 
cd .. 
cp make/mingw64.mk config.mk 
make -j4

最后的git返回以上信息


7.打开Anconda promt

依次输入以下命令

cd xgboost
cd python-package
python setup.py install
 最关键的一步来了,如果这个时候报错

【Cannot find XGBoost Library in the candidate path.................】

      8.下载xgboost.dll

下载地址:链接:http://pan.baidu.com/s/1nuOy4Wh 密码:7opw

将xgboost.dll放在xgboost/python-package/xgboost目录下

     9.再次执行STEP 7

完美收工!!!!!!!!


参考博客:

http://blog.youkuaiyun.com/u012344939/article/details/68064084

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值