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

windows10之上python安装xgboost采用如下步骤(https://stackoverflow.com/questions/33749735/how-to-install-xgboost-package-in-python-windows-platform):

  1. 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)
  2. open command prompt
  3. cd to your Downloads folder (or wherever you saved the whl file)
  4. 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

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值