Switching Python version installed by Homebrew

后端 未结 2 1080
太阳男子
太阳男子 2021-01-03 11:50

I have Python 3.8 and 3.9 installed via Homebrew:

~ brew list | grep python
python@3.8
python@3.9

I want to use Python 3.9 as my default one

2条回答
  •  时光说笑
    2021-01-03 12:31

    Use pyenv. It's a software that lets you switch between any and all Python versions installed on your system. To install pyenv, use the following code in the command-line:

    curl https://pyenv.run | bash
    exec $SHELL
    

    Then find the name of the python version you want to switch to with this:

    pyenv versions
    

    And select it with this:

    pyenv global 
    

    In your case, it's most likely named 3.9.0.

提交回复
热议问题