gpt4 book ai didi

python - 在 jupyter nb v5、win 10、p2.7 中导入 XGBOOST 时出错。通过 conda mndrake 安装

转载 作者:行者123 更新时间:2023-11-30 09:19:58 25 4
gpt4 key购买 nike

任何有关相同问题的帮助将不胜感激!

Windows 10Jupyter 版本 5 python 安装了 mndrake xgboost

我无法在内核中导入 xgboost。它会抛出以下错误。

WindowsError                              Traceback (most recent call last)
<ipython-input-2-afdaff4619ce> in <module>()
----> 1 import xgboost


C:\Anaconda2\lib\site-packages\xgboost\__init__.py in <module>()
9 import os
10
---> 11 from .core import DMatrix, Booster
12 from .training import train, cv
13 from . import rabit # noqa

C:\Anaconda2\lib\site-packages\xgboost\core.py in <module>()
110
111 # load the XGBoost library globally
--> 112 _LIB = _load_lib()
113
114

C:\Anaconda2\lib\site-packages\xgboost\core.py in _load_lib()
104 if len(lib_path) == 0:
105 return None
--> 106 lib = ctypes.cdll.LoadLibrary(lib_path[0])
107 lib.XGBGetLastError.restype = ctypes.c_char_p
108 return lib

C:\Anaconda2\lib\ctypes\__init__.pyc in LoadLibrary(self, name)
441
442 def LoadLibrary(self, name):
--> 443 return self._dlltype(name)
444
445 cdll = LibraryLoader(CDLL)

C:\Anaconda2\lib\ctypes\__init__.pyc in __init__(self, name, mode, handle, use_errno, use_last_error)
363
364 if handle is None:
--> 365 self._handle = _dlopen(self._name, mode)
366 else:
367 self._handle = handle

WindowsError: [Error 126] The specified module could not be found

最佳答案

创建环境变量XGBOOST_BUILD_DOC = 'C:\Users\xxxxxx\Anaconda2\lib\site-packages\xgboost;'

import os    
os.environ['XGBOOST_BUILD_DOC'] = 'C:\\Users\\xxxxxx\\Anaconda2\\lib\\site-packages\\xgboost;'

关于python - 在 jupyter nb v5、win 10、p2.7 中导入 XGBOOST 时出错。通过 conda mndrake 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43502386/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com