Python安装xgboost
1安装anaconda
2安装mingw-w64
下载x86_64-5.3.0-release-win32-seh-rt_v4-rev0.7z
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/threads-win32/seh/
https://sourceforge.net/projects/mingw-w64/
解压到某一目录下
配置环境变量-将C:/mingw64/bin;粘贴到path环境变量下,用“;”隔开。
C:\mingw64\bin;
由于目录 bin\mingw64 下 mingw32-make.exe 名字太长,因此将其重命名为make.exe
3安装git
4安装xgboost在git bash里执行
cd c:\
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
cp make/mingw64.mk config.mk
make -j4
如果编译成功,在xgboost根目录下会出现xgboost.exe
cd python-package (位于xgboost目录下)
python setup.py install (在此之前先安装numpy+mkl和scipy)
在python的IDE下执行
我们必须添加path的G + +运行时库的操作系统环境变量和路径
import os
mingw_path = 'C:\\mingw64\\bin'
os.environ['PATH'] = mingw_path + ';' + os.environ['PATH']
1安装anaconda
2安装mingw-w64
下载x86_64-5.3.0-release-win32-seh-rt_v4-rev0.7z
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/threads-win32/seh/
https://sourceforge.net/projects/mingw-w64/
解压到某一目录下
配置环境变量-将C:/mingw64/bin;粘贴到path环境变量下,用“;”隔开。
C:\mingw64\bin;
由于目录 bin\mingw64 下 mingw32-make.exe 名字太长,因此将其重命名为make.exe
3安装git
4安装xgboost在git bash里执行
cd c:\
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
cp make/mingw64.mk config.mk
make -j4
如果编译成功,在xgboost根目录下会出现xgboost.exe
cd python-package (位于xgboost目录下)
python setup.py install (在此之前先安装numpy+mkl和scipy)
在python的IDE下执行
我们必须添加path的G + +运行时库的操作系统环境变量和路径
import os
mingw_path = 'C:\\mingw64\\bin'
os.environ['PATH'] = mingw_path + ';' + os.environ['PATH']
import xgboost
不报错就是安装成功