XGBoostLibraryNotFound:在候选路径中找不到XGBoost库,是否在根路径中安装了编译器并运行build.sh? [英] XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?

查看:514
本文介绍了XGBoostLibraryNotFound:在候选路径中找不到XGBoost库,是否在根路径中安装了编译器并运行build.sh?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在移动XGBoost的python-package目录时遇到了这个问题.

Traceback (most recent call last): File "setup.py", line 19, in LIB_PATH = libpath'find_lib_path' File "xgboost/libpath.py", line 46, 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?

有人可以向我解释如何解决此问题吗? 预先感谢.

解决方案

在尝试安装不存在xgboost二进制文件的xgboost Python软件包时,您会收到该消息.从源代码安装xgboost Python软件包的正确方法如下(假定您已安装诸如 gcc 之类的编译器):

git clone --recursive https://github.com/dmlc/xgboost.git
cd xgboost
./build.sh
cd python-package
python setup.py install

我更喜欢在虚拟环境中进行操作.请注意,克隆存储库时,选项-recursive 是必不可少的,因为它还将克隆来自不同存储库的文件夹,例如 dmlc-core ,这对于构建xgboost是必需的.

I am facing this problem while moving the python-package directory of XGBoost.

Traceback (most recent call last): File "setup.py", line 19, in LIB_PATH = libpath'find_lib_path' File "xgboost/libpath.py", line 46, 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?

Could anyone explain to me how to fix it? thanks in advance.

解决方案

You get that message when trying to install the xgboost Python package without the xgboost binaries present. The proper way to install the xgboost Python package from source is the following (assuming you have a compiler such as gcc installed):

git clone --recursive https://github.com/dmlc/xgboost.git
cd xgboost
./build.sh
cd python-package
python setup.py install

I prefer to do it inside a virtual environment. Note that the option --recursive when cloning the repo is essential since it will also clone folders from different repos such as dmlc-core which are necessary for building xgboost.

这篇关于XGBoostLibraryNotFound:在候选路径中找不到XGBoost库,是否在根路径中安装了编译器并运行build.sh?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆