環境:windows7 32位 python 2.7
准備安裝最新的0.6,但是坑了。。。。
首先是以為可以pip安裝,很開心,然而並不行,原來文檔上有這么一句話:
- Note for windows users: this pip installation may not work on some windows environment, and it may cause unexpected errors. pip installation on windows is currently disabled for further investigation, please install from github.
。。。。。。please install from github,還是得編譯
這個是github上的安裝向導:
https://github.com/dmlc/xgboost/blob/master/doc/build.md
推薦使用MinGW編譯,然而我不想裝那東西,感覺用不上,准備使用vs編譯,然而我並沒有發現文檔中所說的.sln文件,坑。。。。
很好,成功入坑,然后搜索到python 3.5/3.6使用的有現成的whl文件,太幸福了。。。然而我的版本是2.7
python擴展庫地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost
然后發現網上很多教程有個windows文件夾,然而0.6版本貌似移除了。。。。
然后下載了0.47版本的代碼,使用vs打開了其中的.sln文件,編譯了xgboost_wrapper項目,生成了Xgboost_XXX.dll,將其拷貝到wrapper文件夾,在python-package目錄下使用setup.py,加參數install(具體如下),安裝成功。
python setup.py install
以上就是踩的坑。。。。。套路深