How to make Mac OS use the python installed by Homebrew

前端 未结 6 2105
醉话见心
醉话见心 2020-12-13 04:24

I have searched online for a while for this question, and what I have done so far is

  1. installed python32 in homebrew

  2. changed my .bash_profil

6条回答
  •  情话喂你
    2020-12-13 05:18

    brew install python3 output mentions:

    Unversioned symlinks python, python-config, pip etc. pointing to export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH python3, python3-config, pip3 etc., respectively, have been installed into /usr/local/opt/python/libexec/bin

    So Adding export PATH=/usr/local/opt/python/libexec/bin:$PATH to ~/.bash_profile and then running source ~/.bash_profile gets you those symlinks created by Homebrew - python=python3, pip=pip3 etc :)

    $ python --version

    Python 3.7.0

    $ pip --version

    pip 18.0 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

提交回复
热议问题