title: How to install xgboost for python3.6 in mac
body: <p>I have followed following method <a href="https://stackoverflow.com/questions/39315156/how-to-install-xgboost-in-python-on-macos">link</a> to install in mac.</p>
  
  <p>When I run following command, I get output <code>gcc 7.2.0 already installed</code></p>
  
  <p><code>brew install gcc</code></p>
  
  <p>After that I config.mk file in make folder to following, because I have 7.2.0 gcc installed.</p>
  
  <p><code>export CC = gcc-7</code></p>
  
  <p><code>export CXX = g++-7</code></p>
  
  <p>I run following command <code>make clean_all &amp;&amp; make -j4</code> once I change config.mk file is changed.</p>
  
  <p>Then I run <code>cd python-package; python setup.py install</code>. </p>
  
  <p>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</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Any ideas why it is happening, how to fix it ?</p>