【问题标题】:xgboost error: not a valid Win32 applicationxgboost 错误:不是有效的 Win32 应用程序
【发布时间】:2018-09-28 08:03:56
【问题描述】:

我想使用 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 位操作系统上运行 32 位 Python”你能检查一下你是否安装了 64 位 python 和 xgboost?
  • 是的,我查过了。它是 32 位的。我现在能做什么?
  • 删除并安装正确的版本
  • 哪一个 python 或 xgboost?
  • python 如错误中所说

标签: python xgboost


【解决方案1】:

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

最后我发现XGBoost需要在windows机器上安装Visual Studio 2017 C++ Redistributable。

【讨论】:

    猜你喜欢
    • 2020-07-12
    • 2016-01-13
    • 1970-01-01
    • 1970-01-01
    • 2017-01-07
    • 1970-01-01
    • 1970-01-01
    • 2015-02-26
    • 2015-10-21
    相关资源
    最近更新 更多