在python2.7中安装XGboost和shap

时间:2019-06-11 19:02:13

标签: python python-3.x python-2.7 xgboost

我正在尝试在python 2.7上安装shap和XGboost,但是在尝试导入库时出现此错误:

>>> import shap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\...s\shap\__init__.py", line 7, in <module>
    from .explainers.tree import TreeExplainer, Tree
  File "C:\...\shap\explainers\tree.py", line 17, in <module>
    import xgboost
  File "C:\...\xgboost\__init__.py", line 11, in <module>
    from .core import DMatrix, Booster
  File "C:\...\xgboost\core.py", line 163, in <module>
    _LIB = _load_lib()
  File "C:\...\xgboost\core.py", line 154, in _load_lib
    'Error message(s): {}\n'.format(os_error_list))
xgboost.core.XGBoostError: XGBoost Library (xgboost.dll) could not be loaded.
Likely causes:
  * OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libgomp.so for UNIX-like OSes)
  * You are running 32-bit Python on a 64-bit OS
Error message(s): ['[Error 126] The specified module could not be found']

xgboost出现相同的错误

我正在运行64位python,我不知道为什么它说我正在运行32位版本

也尝试安装OpenMP,但出现此错误:

>pip install openmp --trusted-host pypi.org --trusted-host files.pythonhosted.org
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting openmp
  ERROR: Could not find a version that satisfies the requirement openmp (from versions: none)
ERROR: No matching distribution found for openmp

0 个答案:

没有答案