xgboost错误:不是有效的Win32应用程序

时间:2018-09-28 08:03:56

标签: python xgboost

我想使用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文件并安装了它。

1 个答案:

答案 0 :(得分:0)

对我来说,即使一切都在64位上,我仍然会遇到此错误。

最后,我发现 XGBoost需要在Windows计算机中安装Visual Studio 2017 C ++ Redistributable。