Windows下如何在Python上安装xgboost ?

				版权声明:转载交流请联系微信号:ai_hellohello					https://blog.csdn.net/weixin_41060109/article/details/80878308				</div>
							            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
					<div class="htmledit_views" id="content_views">
            <blockquote style="border-left:3px solid rgb(219,219,219);color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><p style="margin-left:16px;clear:both;min-height:1em;text-align:center;">一个正确的安装过程,敌得过花两小时试了那些所谓的正确方式!</p></blockquote><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);text-align:center;"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);text-align:center;"><img src="https://mmbiz.qpic.cn/mmbiz_jpg/euA8HToHtJphkQ8reLcF0JsialDCG3IVGMgUhRAiaDUFib6H0Oz42CUwu4RONQLETlafQpZ0Oic3zXmAoUHundgIOA/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1" alt=""><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">本文例子环境:python3.6 ,window10,anaconda</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">刚开始试了conda install py-xgboost,建议赶紧停下,不想你遇到那么多坑!</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">以下步骤,简单好用:</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">1.先下载xgboost的.whl文件,</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><img src="https://mmbiz.qpic.cn/mmbiz_png/euA8HToHtJphkQ8reLcF0JsialDCG3IVG6zWxBn07RUnhJKf7024vn7Ayiaz1ViaHhl0BsTtIj0BdNtOiaSbFvw1Sg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1" alt=""></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">2.whl保存到任何地方,如:D盘,D:\xgboost-0.72-cp36-cp36m-win_amd64.whl</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">3.cmd 进入命令行</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">4.切换到Anaconda3装Scripts的路径:</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">&nbsp; $ C:\Anaconda3\Scripts&gt;</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">(如在C:\Anaconda3\Scripts 下 ,shift+右键进入cmd窗口&nbsp;)</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">5.然后根据下载的whl文件的位置,继续:</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">$ C:\Anaconda3\Scripts&gt;&nbsp;<span>pip install &nbsp; 带地址的whl</span>, 如下命令:</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">pip install D:\xgboost-0.72-cp36-cp36m-win_amd64.whl</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br>6.检验</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">python下,import xgboost 没有错误提示即安装成功!</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">若是没安装Anaconda,也没关系,直接pip install&nbsp;D:\xgboost-0.72-cp36-cp36m-win_amd64.whl 也是可行的,前提是pip放在了环境变量里。</p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);"><br></p><p style="clear:both;min-height:1em;color:rgb(51,51,51);font-family:'-apple-system-font', BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;font-size:17px;letter-spacing:.544px;background-color:rgb(255,255,255);">安装成功,就可以放肆的去尝试这款机器学习算法--kaggle爱好者的神器了!</p><pre style="color:rgb(51,51,51);letter-spacing:.544px;background-color:transparent;line-height:inherit;border-width:0px;vertical-align:baseline;text-align:center;"><br>后面的文章,xgboost将会出现!<span style="font-size:12px;"><span style="font-size:16px;color:rgb(62,62,62);line-height:28px;"><span style="line-height:1.75em;color:rgb(63,63,63);letter-spacing:0px;text-align:justify;"><span style="text-align:center;color:rgb(62,62,62);line-height:28px;"><span style="line-height:1.75em;color:rgb(171,25,66);"><br><br><br>当你需要时,记得回来找到这篇文章,或许收藏它。</span></span></span></span></span></pre>            </div>
            </div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值