2016-04-09 15 views
2

Es wurde nur ein Schmerz xgboost Bibliothek zu installieren, aber jetzt andere Fehler passiert unter Windows 8.1 64-Bit-Windows-xgboost Fehler

import xgboost as xgb 

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

Was kann getan werden? Ich denke, es ist, weil, wie Py Dateien ist assoziiert in Windows denke, ich

+0

Scheint wie die Installation von xgb nicht korrekt durchgeführt wird. Irgendwelche Fehler während der Installation? Sie können diese Anleitung zur Installation verwenden: http://StackOverflow.com/Questions/33749735/How-To-Install-xgboost-package-in-python-windows-platform/35119904#35119904 – Deepish

+0

@Deepish Grundsätzlich folgte ich dieser Anweisung schien kein Fehler zu erscheinen. Danach habe ich versucht, eine vorkompilierte Bibliothek zu verwenden, wenn ich sie einfach in meinen Site-Packages-Ordner lege. Es funktioniert immer noch nicht – paveltr

Antwort

2

Ich denke, dass wahrscheinlich die einfachste (schmerzlos) Art und Weise xgboost zu installieren ist hier zu finden:

den Autor

https://dnc1994.com/2016/03/installing-xgboost-on-windows/ (Vielen Dank!)

Ich habe TDM-GCC heruntergeladen, wie vom Autor empfohlen, bevor Sie ihren Anweisungen folgen.

Auch hatte ich ähnliche Probleme bei der Installation xgboost auf 32-Bit-Python, aber habe keine Probleme mit 64-Bit-Python.

Hinweis: Ich bin mit Python 2.7 auf Windows 7.

+0

Sie hatten Recht, das Problem war mit 64 Bit. Jetzt funktioniert es endlich – paveltr

+0

Großartig! Ich bin froh, dass du es geschafft hast – user5042861

1

Gebäude auf Windows hat vor kurzem viel einfacher geworden:

Installieren CMake

CMake kann hier heruntergeladen werden: https://cmake.org/download/

Ich habe die 64-Bit-Zip-Datei heruntergeladen: https://cmake.org/files/v3.6/cmake-3.6.2-win64-x64.zip und entpackt es nach c: \ dev \ cmake-3.6.2-win64-x64.

Bauen XGBoost

zu bauen XGBoost folgenden Schritte aus:

  • git clone https://github.com/dmlc/xgboost.git
  • cd xgboost
  • git Submodul init
  • git Submodul Update
  • mkdir
  • bauen
  • cd build
  • C: \ dev \ cmake-3.6.2-win64-x64 \ bin \ cmake.exe .. -G "Visual Studio 14 2015 * Win64"
  • C: \ Programme (x86) \ MSBuild \ 14.0 \ Bin \ msbuild.exe/t: Clean, neu erstellen/p: Konfiguration = Freigabe xgboost.sln

Oder Laden Sie einfach die Binaries (x64)

Unofficial (Mine) Nightly Builds here.