brew-installed Python not overriding system python

后端 未结 3 1835
生来不讨喜
生来不讨喜 2021-02-01 23:38

I just used brew to install Python 3 on OS X. The python3 command now starts the interpreter using brew Python 3.6, but python still opens the interpr

3条回答
  •  暖寄归人
    2021-02-02 00:20

    One-liner to get homebrew python working:

    zsh

    echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
    

    bash

    echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
    

    Explanation:
    >> filename appends at the end of the file
    source filename reloads the file

提交回复
热议问题