我想使用XGBoost。当我尝试执行代码时,它总是显示下面给出的错误。
Exception has occurred: xgboost.core.XGBoostError
XGBoost Library (xgboost.dll) could not be loaded. Likely causes: * OpenMP
runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows,
libgomp.so for UNIX-like OSes) * You are running 32-bit Python on a 64-bit
OS Error message(s): ['[WinError 193] %1 is not a valid Win32 application']
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 205,
in _call_with_frames_removed
File "G:\study\research\gbm\<frozen importlib._bootstrap_external>",
line 678, in exec_module
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 655,
in _load_unlocked
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 950,
in _find_and_load_unlocked
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 961,
in _find_and_load
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 205,
in _call_with_frames_removed
File "G:\study\research\gbm\<frozen importlib._bootstrap_external>",
line 678, in exec_module
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 655,
in _load_unlocked
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 950,
in _find_and_load_unlocked
File "G:\study\research\gbm\<frozen importlib._bootstrap>", line 961,
in _find_and_load
File "G:\Study\Research\GBM\gbm.py", line 4, in <module>
from xgboost import XGBClassifier
我安装了xgboost,下载了dll文件并安装了它。
对我来说即使一切都在64位我仍然有这个错误。
最后我发现XGBoost需要在Windows机器上安装Visual Studio 2017 C ++ Redistributable。