Install Python 3 to /usr/bin/ on macOS
<p>I installed python2.x and python3.x using homebrew and the executable python paths are listed below:</p>

<pre><code>$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

$ which python3
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
</code></pre>

<p><br>
It's quite too long and not so clean to write a shebang in a python code to make it runnable on Terminal:</p>

<pre><code>#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python OR
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
</code></pre>

<p><br>
I prefer</p>

<pre><code>#!/usr/bin/python OR
#!/usr/bin/python3
</code></pre>

<p>My issue here is, how can I correcly move or reinstall python on macOS to <b>/usr/bin</b> such as <br> <code>/usr/bin/python</code> OR <code>/usr/bin/python3</code> <br><br>Instead of <br>
<code>/Library/Frameworks/Python.framework/Versions/2.7/bin/python</code>
<code>/Library/Frameworks/Python.framework/Versions/3.5/bin/python3</code></p>

<p>Create a symbolic link in <code>/usr/bin/</code></p>

<p>Open terminal and do:</p>

<pre>$ sudo ln /Library/Frameworks/Python.framework/Versions/2.7/bin/python /usr/bin/python
$ sudo ln /Library/Frameworks/Python.framework/Versions/3.5/bin/python3 /usr/bin/python3
</pre>

<p>You can now do what you wanted to do.</p>

python osx python-3.x path