我正在使用蟒蛇。我首先切换到 Python2(版本 2.7.11)。
python -V
Python 2.7.11 :: Continuum Analytics, Inc.
我使用以下命令在 anaconda 中安装 xgboost。
conda install -c https://conda.anaconda.org/akode xgboost
然后我检查了是否安装了 xgboost。
conda list
xgboost 0.3 py27_0 akode
我在终端中运行 python,导入 xgboost 并得到以下错误。
import xgboost as xgb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/envs/wen2/lib/python2.7/site-packages/xgboost.py", line 82, in <module>
xglib = load_xglib()
File "//anaconda/envs/wen2/lib/python2.7/site-packages/xgboost.py", line 59, in load_xglib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "//anaconda/envs/wen2/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "//anaconda/envs/wen2/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(//anaconda/envs/wen2/lib/python2.7/site-packages/libxgboostwrapper.so, 6): Library not loaded: @rpath/./libgomp.1.dylib
Referenced from: //anaconda/envs/wen2/lib/python2.7/site-packages/libxgboostwrapper.so
Reason: image not found
我不知道下一步该做什么。