'How to download/install xgboost for python (Jupyter notebook)

When I do pip install xgboost I get an error as shown below. I believe there is another method using git? But I don't understand how to do that exactly (step by step) - I'm new to this stuff. Help is much appreciated

192-168-1-10:Desktop yadav_sa$ 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
        clang-omp++ -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: clang-omp++: command not found
        clang-omp++ -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
        make: *** [build/learner.o] Error 127
        make: *** Waiting for unfinished jobs....
        /bin/sh: clang-omp++: command not found
        make: *** [build/logging.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
        clang-omp++ -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: clang-omp++: command not found
        make: *** [build/learner.o] Error 127
        make: *** Waiting for unfinished jobs....
        clang-omp++ -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
        /bin/sh: clang-omp++: command not found
        make: *** [build/logging.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 "/private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/setup.py", line 29, in <module>
            LIB_PATH = libpath['find_lib_path']()
          File "/private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/libpath.py", line 45, in find_lib_path
            'List of candidates:\n' + ('\n'.join(dll_path)))
        XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
        List of candidates:
        /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/libxgboost.so
        /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/../../lib/libxgboost.so
        /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/xgboost/./lib/libxgboost.so

        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/t8/y5n13zb97n1576yvs58vqhm4003cyx/T/pip-build-xcknr88x/xgboost/

I need this package for python machine learning. I am on a mac.enter image description here

Here I followed the official installation guide but I receive an error.

192-168-1-10:xgboost yadav_sa$ cd xgboost; cp make/config.mk ./config.mk; make -j4
-bash: cd: xgboost: Not a directory
c++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -o xgboost  build/cli_main.o build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/common/hist_util.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_fast_hist.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a  -pthread -lm  -fopenmp 
c++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -shared -o lib/libxgboost.so build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/common/hist_util.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_fast_hist.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm  -fopenmp 
ar crv lib/libxgboost.a 
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
make: *** [lib/libxgboost.a] Error 1
make: *** Waiting for unfinished jobs....
clangclang: : error: error: unsupported option '-fopenmp'unsupported option '-fopenmp'

make: *** [lib/libxgboost.so] Error 1
make: *** [xgboost] Error 1


Solution 1:[1]

there is official installation guide:

http://xgboost.readthedocs.io/en/latest/build.html#installation-guide

Solution 2:[2]

!pip install xgboost

Just copy and paste the code into your notebook, works like magic

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pkisztelinski
Solution 2 Josiah