您的位置:首页 > 编程语言 > Python开发

window10 安装python xgboost出现WindowsError: [Error 126]

2017-11-16 23:04 591 查看
windows10之上python安装xgboost采用如下步骤(https://stackoverflow.com/questions/33749735/how-to-install-xgboost-package-in-python-windows-platform):

download xgboost whl file from here (make
sure to match your python version and system architecture, e.g. "xgboost-0.6-cp35-cp35m-win_amd64.whl" for python 3.5 on 64-bit machine)

open command prompt

cd
to
your Downloads folder (or wherever you saved the whl file)

pip
install xgboost-0.6-cp35-cp35m-win_amd64.whl
(or whatever your whl file is named)

安装成功之后,import xgboost时,报如下错误信息:

import xgboost as xgb

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "xgboost\__init__.py", line 11, in <module>

from .core import DMatrix, Booster

File "xgboost\core.py", line 115, in <module>

_LIB = _load_lib()

File "xgboost\core.py", line 109, in _load_lib

lib = ctypes.cdll.LoadLibrary(lib_path[0])

File "C:\Python27\lib\ctypes\__init__.py", line 444, in LoadLibrary

return self._dlltype(name)

File "C:\Python27\lib\ctypes\__init__.py", line 366, in __init__

self._handle = _dlopen(self._name, mode)

WindowsError: [Error 126]

造成该问题的原因为:电脑缺少VC++相关运行库。

解决方法:下载VC++运行库,64位版本下载地址为 https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=48145
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: