title: Installing Homebrew Python and linking
body: <p>I need to use the Homebrew version of Python rather than the system version of Python. I have a clean install of macOS Sierra (10.12.5).</p>
  
  <p>I first installed homebrew and then updated <code>~/.bash_profile</code> using <code>nano ~/.bash_profile</code>.
  Then I added this into the file:</p>
  
  <pre><code># Homebrew
  export PATH=/usr/local/bin:$PATH
  </code></pre>
  
  <p>Then, I needed to manually source the <code>~/.bash_profile</code> file to ensure the changes have been reloaded using <code>source ~/.bash_profile</code>.</p>
  
  <p>I installed python using <code>brew install python</code> and tried to link using <code>brew linkapps python</code></p>
  
  <p>The output was this:</p>
  
  <pre><code>Warning: Already linked: /usr/local/Cellar/python/2.7.13_1
  To relink: brew unlink python &amp;&amp; brew link python
  Gautams-Air:~ gautam$ which python
  /usr/bin/python
  Gautams-Air:~ gautam$ python -V
  Python 2.7.10
  Gautams-Air:~ gautam$ brew linkapps python
  Warning: brew linkapps has been deprecated and will eventually be removed!
  
  Unfortunately brew linkapps cannot behave nicely with e.g. Spotlight using
  either aliases or symlinks and Homebrew formulae do not build "proper" .app
  bundles that can be relocated. Instead, please consider using brew cask and
  migrate formulae using .app's to casks.
  Linking: /usr/local/opt/python/IDLE.app
  Linking: /usr/local/opt/python/Python Launcher.app
  Linked 2 apps to /Applications`
  </code></pre>
  
  <p>Using <code>which python</code> the output was:
  <code>/usr/bin/python</code></p>
  
  <p>It should have been: <code>/usr/local/bin/python</code></p>
  
  <p>I also tried using: <code>brew unlink python &amp;&amp; brew link python</code></p>
  
  <p>Also using <code>python -V</code> it shows <code>Python 2.7.10</code> although the current version in Homebrew is <code>Python 2.7.13</code></p>
  
  <p>How do I use the Homebrew version of Python instead of the system version of Python? - How do I do the linking?</p>
  
  <p>USING:
  macOS Sierra (10.12.5)</p>