xgboost installation issue with anaconda

前端 未结 7 1064
庸人自扰
庸人自扰 2020-12-30 05:54

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

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

I used the followin

7条回答
  •  执念已碎
    2020-12-30 06:10

    I had a similar problem

    >>> import xgboost
    /usr/local/anaconda2/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
      "This module will be removed in 0.20.", DeprecationWarning)
    Traceback (most recent call last):
      File "", line 1, in 
      File "/usr/local/anaconda2/lib/python2.7/site-packages/xgboost/__init__.py", line 11, in 
        from .core import DMatrix, Booster
      File "/usr/local/anaconda2/lib/python2.7/site-packages/xgboost/core.py", line 112, in 
        _LIB = _load_lib()
      File "/usr/local/anaconda2/lib/python2.7/site-packages/xgboost/core.py", line 106, in _load_lib
        lib = ctypes.cdll.LoadLibrary(lib_path[0])
      File "/usr/local/anaconda2/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
        return self._dlltype(name)
      File "/usr/local/anaconda2/lib/python2.7/ctypes/__init__.py", line 362, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: /usr/local/anaconda2/bin/../lib/libgomp.so.1: version `GOMP_4.0' not found (required by /usr/local/anaconda2/lib/python2.7/site-packages/xgboost/./lib/libxgboost.so)
    

    In my case the problem is that i installed xgboost with a regular user. So i did

    sudo su
    pip uninstall xgboost
    pip install xgboost
    python
    >>> import xgboost
    /usr/local/anaconda2/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
      "This module will be removed in 0.20.", DeprecationWarning)
    >>> ~
    

    Hope this can help!

提交回复
热议问题