【问题标题】:Xgboost installation on Mac在 Mac 上安装 Xgboost
【发布时间】:2017-06-19 20:50:43
【问题描述】:

我正在尝试在我的 mac (10.12.5) 上安装 xgboost,但经过几次尝试我没有成功。我遵循不同的教程尝试通过添加 gcc-6 来修改 gcc 变量,但我有同样的问题。

所以我做了什么:

  1. git clone --recursive https://github.com/dmlc/xgboost
  2. cd xgboost; cp make/minimum.mk ./config.mk; make -j4

我有以下错误:

/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/learner.o src/learner.cc >build/learner.d
/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/logging.o src/logging.cc >build/logging.d
/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d
/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d
/bin/sh: /usr/local/bin/g++: No such file or directory
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [build/logging.o] Error 127
make: *** [build/c_api/c_api.o] Error 127
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [build/c_api/c_api_error.o] Error 127

我的 gcc 版本是:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

我真的需要你的帮助。目前我使用pip install xgboost 来使用该库,但我知道这不是使用该库的正确方法。 谢谢你的帮助

ps:对不起,如果我的英语不好,我不流利

【问题讨论】:

    标签: python macos xgboost


    【解决方案1】:

    在这种情况下,使用 Docker 镜像可以提供最大的帮助,因为它封装了环境。您可以从here 安装 Docker。如果你想使用 xgboost 库,你可以使用以下命令拉取图像,

    docker pull datmo/xgboost:cpu
    

    之后,您可以使用此映像运行容器并挂载必要的文件以运行相同的环境。

    您还可以使用datmo CLI 来轻松设置环境并控制机器学习模型的版本。

    【讨论】:

      【解决方案2】:

      试试这个它的工作原理

      $ brew install gcc-5
      $ brew install cmake
      $ pip install xgboost
      

      【讨论】:

        【解决方案3】:

        我可以使用 conda 在我的 Mac 上安装 xgboost。

        尝试“conda install py-xgboost”。这对我有用。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-07-02
          • 2016-08-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多