简体   繁体   中英

How to install xgboost for python3.6 in mac

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 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 ?

$ brew install gcc@5
$ pip install xgboost

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM