Anaconda的xgboost安装问题

Anaconda的xgboost安装问题

本文介绍了Anaconda的xgboost安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Anaconda.我首先切换到Python2(版本2.7.11).

I am using Anaconda. I first switched to Python2 (Version 2.7.11).

python -V
Python 2.7.11 :: Continuum Analytics, Inc.

我使用以下命令在anaconda中安装xgboost.

I used the following command to install xgboost in anaconda.

conda install -c https://conda.anaconda.org/akode xgboost

然后我检查是否已安装xgboost.

I then checked that xgboost is installed.

conda list
xgboost                   0.3                      py27_0    akode

我在终端中运行python,导入xgboost并收到以下错误.

I run python in terminal, import xgboost and got the following errors.

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

我不知道下一步该怎么做.

I have no idea what to do next.

推荐答案

您下载的软件包映像已损坏.您应该做什么:

The package image you download is corrupt.What you should do :

首先使用(在终端中)删除xgboost软件包:

First remove your xgboost package with (in the terminal) :

然后使用 https://anaconda.org/aterrel/xgboost 上的其他软件包重新安装.所以只要写:

Then reinstall with an other package at https://anaconda.org/aterrel/xgboostSo just write :

然后您可以在python控制台中检查安装:

Then you can check the installation in the python console :

应该没事的.

这篇关于Anaconda的xgboost安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 23:52