1

I have followed following method link to install in mac.

When I run following command, I get output gcc 7.2.0 already installed

brew install gcc

After that I config.mk file in make folder to following, because I have 7.2.0 gcc installed.

export CC = gcc-7

export CXX = g++-7

I run following command make clean_all && make -j4 once I change config.mk file is changed.

Then I run cd python-package; python setup.py install.

If without closing terminal i go to python3.6, where I can access xgboost without problem. However, when I switch to different terminal, I am getting following error

OSError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/xgboost/./lib/libxgboost.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/5/libgomp.1.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/xgboost/./lib/libxgboost.so
  Reason: image not found

Any ideas why it is happening, how to fix it ?

Kush Patel
  • 3,685
  • 5
  • 42
  • 65
  • 1
    Check this page. https://stackoverflow.com/questions/39315156/how-to-install-xgboost-in-python-on-macos – Kevin Sep 18 '17 at 20:26

1 Answers1

-2
$ brew install gcc@5
$ pip install xgboost

It worked for me.[xgboost==0.6a2]

PritamJ
  • 337
  • 4
  • 10