1. 程式人生 > >【Python學習】win10下xgboost Python安裝教程

【Python學習】win10下xgboost Python安裝教程

注:本文主要轉自ychanmy的部落格,地址為:http://blog.csdn.net/ychanmy/article/details/50972530

1.  安裝anaconda

        連結:https://www.continuum.io/downloads#_windows,我下載的版本是python2.7,安裝在D盤(隨便裝哪個盤都可以,但是要記住路徑,因為要寫入環境變數的),這裡anaconda的路徑其實就是python的路徑。下面配置path環境變數(附圖):


2. 下載安裝mingw-w64

        下載地址:https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/threads-win32/seh/,點選下載x86_64-5.3.0-release-win32-seh-rt_v4-rev0.7z,適用64位作業系統。

        另外,建議不要使用mingw-w64-install.exe(170.0 kB)線上下載,因為在選擇安裝版本後下載有些版本會崩掉(比如本版本),解壓到某一目錄下,我放到了C盤根目錄。(目錄最好不要有中文字元),配置環境變數。將C:/mingw64/bin;貼上到path環境變數下,用“;”隔開。我的電腦圖示->右鍵->屬性->高階系統設定->選擇“高階”選項->選擇下面“環境變數”->使用者變數或者系統變數均可,若無path則建立一個path變數。

       進入目錄C:/mingw64/bin,找到mingw32-make.exe更名為make(為了使用方便)。成功後,在cmd下輸入make會返回“make: *** No targets specified andno makefile found.  Stop.”。

3. 安裝Git

        連結:https://git-scm.com/download/win

4.安裝xgboost

        第3步已經裝好了一個叫git bash的東西,然後的呼入下列依次命令:

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

        ②cd xgboost

        進入xgboost路徑了:

       ③ git submodule init

       ④git submodule update

       ⑤cp make/mingw64.mk config.mk

       ⑥make -j4

       然後進入xgboost路徑下的python-package

       ⑦cd python-package

       ⑧python setup.py install

       至此,安裝完成!