paveltr paveltr - 1 year ago 266
Python Question

Windows xgboost error

It was a pain just to install xgboost library, but now other mistake happened on Windows 8.1 64-bit

import xgboost as xgb

Traceback (most recent call last):
File "C:/Users/Пашка/PycharmProjects/kaggler bank santander/", line 12, in <module>
import xgboost as xgb
File "C:\Python34\lib\site-packages\xgboost-0.4-py3.4.egg\xgboost\", line 11, in <module>
from .core import DMatrix, Booster
File "C:\Python34\lib\site-packages\xgboost-0.4-py3.4.egg\xgboost\", line 83, in <module>
_LIB = _load_lib()
File "C:\Python34\lib\site-packages\xgboost-0.4-py3.4.egg\xgboost\", line 77, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "C:\Python34\lib\ctypes\", line 429, in LoadLibrary
return self._dlltype(name)
File "C:\Python34\lib\ctypes\", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

What can be done? I think it is because of how .py files associated in Windows I guess

Answer Source

I think that probably the simplest (most painless) way to install xgboost can be found here: (Much thanks to the author!)

I downloaded TDM-GCC as recommended by the author prior to following their instructions.

Also, I had similar issues installing xgboost on 32-bit Python but am having no issues using 64-bit Python.

Note: I'm running Python 2.7 on Windows 7.