【问题标题】:Installing XGBoost on EC2在 EC2 上安装 XGBoost
【发布时间】:2017-11-15 16:23:12
【问题描述】:

我正在尝试在 EC2 实例上安装 XGBoost,并在尝试“pip install xgboost”后不断收到以下错误:

> Collecting xgboost
  Using cached xgboost-0.6a2.tar.gz
    Complete output from command python setup.py egg_info:
    rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost
    g++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
    g++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
    /bin/sh: g++: command not found
    make: *** [build/logging.o] Error 127
    make: *** Waiting for unfinished jobs....
    g++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/common/common.o src/common/common.cc >build/common/common.d
    /bin/sh: g++: command not found
    make: *** [build/learner.o] Error 127
    /bin/sh: g++: command not found
    make: *** [build/common/common.o] Error 127
    -----------------------------
    Building multi-thread xgboost failed
    Start to build single-thread xgboost
    rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost
    g++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
    g++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
    /bin/sh: g++: command not found
    make: *** [build/logging.o] Error 127
    make: *** Waiting for unfinished jobs....
    g++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/common/common.o src/common/common.cc >build/common/common.d
    /bin/sh: g++: command not found
    make: *** [build/learner.o] Error 127
    /bin/sh: g++: command not found
    make: *** [build/common/common.o] Error 127
    Successfully build single-thread xgboost
    If you want multi-threaded version
    See additional instructions in doc/build.md
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-TkrTN6/xgboost/setup.py", line 29, in <module>
        LIB_PATH = libpath['find_lib_path']()
      File "/tmp/pip-build-TkrTN6/xgboost/xgboost/libpath.py", line 45, in find_lib_path
        'List of candidates:\n' + ('\n'.join(dll_path)))
    __builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
    List of candidates:
    /tmp/pip-build-TkrTN6/xgboost/xgboost/libxgboost.so
    /tmp/pip-build-TkrTN6/xgboost/xgboost/../../lib/libxgboost.so
    /tmp/pip-build-TkrTN6/xgboost/xgboost/./lib/libxgboost.so

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-TkrTN6/xgboost/

我正在使用最新版本的 Anaconda (Linux)。我尝试使用 miniconda 并安装所有需要的软件包,但没有成功。此外,我已经尝试了我找到的所有建议 here

非常感谢任何建议/解决方案。

【问题讨论】:

    标签: python linux amazon-web-services amazon-ec2 xgboost


    【解决方案1】:

    您缺少g++ 编译器。

    您没有提及您正在运行哪个 Linux。

    亚马逊 Linux:

    yum install make glibc-devel gcc 补丁

    【讨论】:

    • 谢谢你的建议,我试过了说我需要成为root用户。我正在努力解决这个问题。
    • 再次感谢您尝试帮助我,但我尝试将 sudo 添加到命令的前面并出现相同的错误。然后我运行“sudo su”并尝试再次安装,同样的错误。 linux 版本为“Amazon Linux AMI 2017.09.1 (HVM), SSD Volume Type”。列表中的第一个。
    • 如果您输入“sudo yum install make glibc-devel gcc patch”,具体错误是什么?输入“sudo sh”而不是“sudo su”以打开具有 root 权限的 shell。
    • sh-4.2# sudo yum install make glibc-devel gcc patch 加载的插件:priorities, update-motd, upgrade-helper 包 1:make-3.82-21.10.amzn1.x86_64 已经安装和最新版本软件包 glibc-devel-2.17-196.172.amzn1.x86_64 已安装且最新版本软件包 gcc-4.8.5-1.22.amzn1.noarch 已安装且最新版本软件包 patch-2.7.1-8.9.amzn1.x86_64 已安装且最新版本无关sh-4.2#
    • 尝试“sudo yum install gcc-c++”或“sudo yum groupinstall “开发工具””
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-20
    • 2015-02-10
    • 2014-08-04
    相关资源
    最近更新 更多