win10 x64安装xgboost错误解决

win10 安装xgboost时遇到了比Ubuntu下多得多的问题。
直接使用

conda install xgboost 

出现如下错误:

PackageNotFoundError: Packages missing in current channels:

  - xgboost

We have searched for the packages in the following channels:

 1. https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'/win-64
 2. https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'/noarch
 3. https://repo.continuum.io/pkgs/main/win-64
 4. https://repo.continuum.io/pkgs/main/noarch
 5. https://repo.continuum.io/pkgs/free/win-64
 6. https://repo.continuum.io/pkgs/free/noarch
 7. https://repo.continuum.io/pkgs/r/win-64
 8. https://repo.continuum.io/pkgs/r/noarch
 9. https://repo.continuum.io/pkgs/pro/win-64
 10. https://repo.continuum.io/pkgs/pro/noarch
 11. https://repo.continuum.io/pkgs/msys2/win-64
 12. https://repo.continuum.io/pkgs/msys2/noarch

使用 pip install xgboost 也有问题。
正确的解决步骤如下:
1. 下载源码 git clone --recursive https://github.com/dmlc/xgboost
2. 进入xgboost python-package 目录,直接安装会出现:

C:\Anaconda2\xgboost\python-package>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 19, in <module>
    LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()]
  File "xgboost/libpath.py", line 49, in find_lib_path
    'List of candidates:\n' + ('\n'.join(dll_path)))
__builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?
List of candidates:
C:\Anaconda2\xgboost\python-package\xgboost\xgboost.dll
C:\Anaconda2\xgboost\python-package\xgboost\../../lib/xgboost.dll
C:\Anaconda2\xgboost\python-package\xgboost\./lib/xgboost.dll
C:\Anaconda2\xgboost\xgboost.dll
C:\Anaconda2\xgboost\python-package\xgboost\../../windows/x64/Release/xgboost.dll
C:\Anaconda2\xgboost\python-package\xgboost\./windows/x64/Release/xgboost.dll

这是因为缺少xgboost.dll 链接包所致,可以下载该动态链接库,放到以上任意目录。
3. 重新执行 python setup.py install 问题解决

.....
Installed c:\anaconda2\lib\site-packages\xgboost-0.6-py2.7.egg
Processing dependencies for xgboost==0.6
Searching for scipy==0.19.1
Best match: scipy 0.19.1
Adding scipy 0.19.1 to easy-install.pth file

Using c:\anaconda2\lib\site-packages
Searching for numpy==1.13.1
Best match: numpy 1.13.1
Adding numpy 1.13.1 to easy-install.pth file

Using c:\anaconda2\lib\site-packages
Finished processing dependencies for xgboost==0.6
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值