简体   繁体   English

在python上的Windows上的Xgboost安装问题

[英]Xgboost installation issue on windows on python

I am trying to install the Xgboost library. 我正在尝试安装Xgboost库。 The problem is that I am on a virtual machine behind a firewall i don't have access to (company computer). 问题是我在防火墙后面的虚拟机上没有访问权限(公司计算机)。 I have the Xgboost library that I downloaded from github. 我有从github下载的Xgboost库。

Then I tried to add the path manually to through the Pycharm project interpreter, therefor i don't have any import error detected, the auto completion is even working but when I try to run the code I have this error : 然后我尝试通过Pycharm项目解释器手动添加路径,因此我没有检测到任何导入错误,自动完成甚至工作,但当我尝试运行代码时,我有这个错误:

Traceback (most recent call last): File "C:/Users/UT2BUP/PycharmProjects/AccountingAdjustment/Run/Execution.py", line 1, in from Run.Main import Main File "C:\\Users\\UT2BUP\\PycharmProjects\\AccountingAdjustment\\Run\\Main.py", line 22, in import Modeling.SkLearnHelper as Sk File "C:\\Users\\UT2BUP\\PycharmProjects\\AccountingAdjustment\\Modeling\\SkLearnHelper.py", line 35, in import Modeling.Stacking as Stk File "C:\\Users\\UT2BUP\\PycharmProjects\\AccountingAdjustment\\Modeling\\Stacking.py", line 6, in import xgboost as xg File "C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost__init__.py", line 11, in from .core import DMatrix, Booster File "C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost\\core.py", line 112, in _LIB = _load_lib() File "C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost\\core.py", line 103, in _load_lib lib_path = find_lib_path() File "C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost\\libpath.py", line 46, in find_lib_path 'Li 回溯(最近一次调用最后一次):文件“C:/Users/UT2BUP/PycharmProjects/AccountingAdjustment/Run/Execution.py”,第1行,来自Run.Main导入主文件“C:\\ Users \\ UT2BUP \\ PycharmProjects \\ AccountingAdjustment \\运行\\ Main.py“,第22行,导入Modeling.SkLearnHelper作为Sk文件”C:\\ Users \\ UT2BUP \\ PycharmProjects \\ AccountingAdjustment \\ Modeling \\ SkLearnHelper.py“,第35行,导入Modeling.Stacking as Stk File” C:\\ Users \\ UT2BUP \\ PycharmProjects \\ AccountingAdjustment \\ Modeling \\ Stacking.py“,第6行,导入xgboost为xg文件”C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost__init __。py“,第11行,来自.core导入DMatrix,Booster文件“C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost \\ core.py”,第112行,在_LIB = _load_lib()文件“C: \\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost \\ core.py“,第103行,在_load_lib中lib_path = find_lib_path()文件”C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost \\ libpath.py“,第46行,在find_lib_path'Li中 st of candidates:\\n' + ('\\n'.join(dll_path))) 候选人:\\ n'+('\\ n'.join(dll_path)))

xgboost.libpath.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path? xgboost.libpath.XGBoostLibraryNotFound:在候选路径中找不到XGBoost库,是否安装了编译器并在根路径中运行build.sh? List of candidates: C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost\\libxgboost.dll C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost../../lib/libxgboost.dll C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost./lib/libxgboost.dll C:\\ProgramData\\Anaconda3\\xgboost\\libxgboost.dll C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost../../windows/x64/Release/libxgboost.dll C:\\Users\\UT2BUP\\Downloads\\xgboost-master\\python-package\\xgboost./windows/x64/Release/libxgboost.dll 候选列表:C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost \\ libxgboost.dll C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost ../../ lib / libxgboost.dll C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost./lib/libxgboost.dll C:\\ ProgramData \\ Anaconda3 \\ xgboost \\ libxgboost.dll C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost ../../ windows / x64 / Release / libxgboost.dll C:\\ Users \\ UT2BUP \\ Downloads \\ xgboost-master \\ python-package \\ xgboost./windows/x64/Release /libxgboost.dll

So I tried to install with PIP in local but when I do 所以我尝试在本地安装PIP,但是当我这样做的时候

python pip install C:\Users\UT2BUP\Downloads\xgboost-master\python-package

I got the same error as above (2nd part only). 我得到了与上面相同的错误(仅限第二部分)。
Any ideas ? 有任何想法吗 ?

The most straightforward way is to download the xgboost wheel and install using pip. 最直接的方法是下载xgboost轮并使用pip进行安装。

pip install xgboost‑0.6‑cp36‑cp36m‑win_amd64.whl

The other option is what you are trying to do now. 另一种选择是你现在要做的。 To build from source, you have to make sure your compiler is set up. 要从源代码构建,您必须确保已设置编译器。 For instructions on that, I suggest you start on the Windows Compilers page, then visit the docs for compiling xgboost . 有关这方面的说明,我建议您从Windows编译器页面开始,然后访问用于编译xgboost的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM