2016-08-14 208 views
1

我成功安裝了xgboost,但是當我導入它時,出現如下所示的問題。我無法弄清楚這個問題。在python中導入xgboost導致錯誤

>> import xgboost as xgb 
    Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/home/deploy/anaconda3/lib/python3.5/site-packages/xgboost/__init__.py", line 11, in <module> from 
    .core import DMatrix, Booster 
    File "/home/deploy/anaconda3/lib/python3.5/site-packages/xgboost/core.py", line 112, in <module> 
    _LIB = _load_lib() 
    File "/home/deploy/anaconda3/lib/python3.5/site-packages/xgboost/core.py", line 106, in _load_lib 
    lib = ctypes.cdll.LoadLibrary(lib_path[0]) 
    File "/home/deploy/anaconda3/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary 
    return self._dlltype(name) 
    File "/home/deploy/anaconda3/lib/python3.5/ctypes/__init__.py", line 347, in __init__ 
    self._handle = _dlopen(self._name, mode) 
    OSError: /home/deploy/anaconda3/lib/python3.5/site-packages/xgboost/./lib/libxgboost.so: invalid ELF header 
+0

有點作爲https://github.com/dmlc/xgboost/issues/463#issuecomment-147365960,手動安裝可能會成功嗎? – VonC

+0

你是如何安裝的? @VonC最有可能。 –

+0

這將是鏈接中提到的配方的'sudo。/ build.sh'部分。 – VonC

回答

0

Reinistalling如下固定爲我

conda remove xgboost 

conda install py-xgboost