win10+python3安装Xgboost
2017-12-28 22:24
441 查看
安装步骤:
安装Git for Windows打开 bash:
输入:git clone –recursive https://github.com/dmlc/xgboost
等待clone完成
然后在bash中输入:
git submodule init
git submodule update
修改.bashrc文件:该文件在你所安装的Git目录下etc文件夹中:
即bash.bashrc文件。在该文件末尾添加:
alias make=’mingw32-make’
将编译好的xgboost.dll文件放在clone下来的xgboost文件夹下的python-package\xgboost’目录中:如C:\Users\CZD\xgboost\python-package\xgboost(此为我的电脑上的路径,clone的xgboost在C:\Users\CZD\目录下)
如果您用的是Anaconda3,此时可以打开Anaconda Prompt(类似于cmd):使用cd 命令切换到xgboost\python-package目录下:
Anaconda Prompt
cd C:\Users\CZD\xgboost\python-package python setup.py install1
2
3
注:C:\Users\CZD\xgboost\python-package(为本人电脑路径)
测试是否安装成功
import xgboost as xgb没有报错,即为安装成功xgboost错误解决:C:\Anaconda3\xgboost\python-package>python setup.py install Traceback (most recent call last): File "setup.py", line 19, in <module> LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()] File "xgboost/libpath.py", line 49, in find_lib_path 'List of candidates:\n' + ('\n'.join(dll_path))) __builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path? List of candidates: C:\Anaconda3\xgboost\python-package\xgboost\xgboost.dll C:\Anaconda3\xgboost\python-package\xgboost\../../lib/xgboost.dll C:\Anaconda3\xgboost\python-package\xgboost\./lib/xgboost.dll C:\Anaconda3\xgboost\xgboost.dll C:\Anaconda3\xgboost\python-package\xgboost\../../windows/x64/Release/xgboost.dll C:\Anaconda3\xgboost\python-package\xgboost\./windows/x64/Release/xgboost.dll1
2
3
4
5
6
7
8
9
10
11
12
13
14
这是因为缺少xgboost.dll 链接包所致,可以下载该动态链接库,放到以上任意目录。
3. 重新执行
python setup.py install问题解决
福利:
下载windows下的编译好的xgboost库文件
这里我选择的是2017年6月10号编译的dll,也就是当前源码对应的那一天的dll
http://ssl.picnet.com.au/xgboost/20170610/x64/libxgboost.dll
大家请在页面:http://www.picnet.com.au/blogs/guido/post/2016/09/22/xgboost-windows-x64-binaries-for-download/
选择最新编译的dll,因为最新的dll与xgboost的源码更为适配。
下载好之后将这个库文件放入到master\python-package\xgboost目录
注意:如果你有NVIDIA的GPU,可以下载http://ssl.picnet.com.au/xgboost/20170610/x64_gpu/libxgboost.dll,这个是GPU版本的动态链接库
相关文章推荐
- Win10(64位)python3.6 xgboost 详细安装教程(极速版)
- 64位win10下安装xgboost python包的教程
- Win10+64位+python2.7+Xgboost安装
- 解决:win10_x64 xgboost python安装所遇到问题
- 在win10下安装xgboost, python 为3.5
- win10 64位,anacoda2,python 2.7 下安装xgboost
- Python2.7+Win10 安装Xgboost
- win10(64位)python xgboost 详细安装教程
- win10系统下python2.7安装xgboost,lightgbm神器
- windows 新版xgboost Python包安装教程 win10 64
- 64位win10下安装xgboost python包的教程
- win10安装xgboost python版
- Windows下安装python版的XGBoost(Anaconda)
- windows下,在python中安装xgboost的简易方法,解决 error C3861: “sleep”: 找不到标识符”
- Windows 下安装 xgboost for python
- centos7下xgboost,python安装
- win10 下xgboost的安装----终极版
- Mac 安装 XGBoost Python库
- python2.7 安装xgboost
- 最新xgboost python32位下安装xgboost