在新版本的macos中已经将默认的python升级成了3.x , 今天介绍一个简单的方法在新版本的macos中快速安装 python 2.7的方法, 就是使用brew安装python版本管理工具 pyenv来安装python2.7
# 安装pyenv版本管理工具
brew install pyenv
# 安装python2.7 可以安装多个版本的ptyhon
pyenv install 2.7.18
pyenv可安装的python版本和相关包列表,
可见 该工具可以安装 python 2.1.3 到最新版本的python3.x
➜ ~ pyenv install --list
Available versions:2.1.32.2.32.3.72.4.02.4.12.4.22.4.32.4.42.4.52.4.62.5.02.5.12.5.22.5.32.5.42.5.52.5.62.6.02.6.12.6.22.6.32.6.42.6.52.6.62.6.72.6.82.6.92.7.02.7-dev2.7.12.7.22.7.32.7.42.7.52.7.62.7.72.7.82.7.92.7.102.7.112.7.122.7.132.7.142.7.152.7.162.7.172.7.183.0.13.1.03.1.13.1.23.1.33.1.43.1.53.2.03.2.13.2.23.2.33.2.43.2.53.2.63.3.03.3.13.3.23.3.33.3.43.3.53.3.63.3.73.4.03.4-dev3.4.13.4.23.4.33.4.43.4.53.4.63.4.73.4.83.4.93.4.103.5.03.5-dev3.5.13.5.23.5.33.5.43.5.53.5.63.5.73.5.83.5.93.5.103.6.03.6-dev3.6.13.6.23.6.33.6.43.6.53.6.63.6.73.6.83.6.93.6.103.6.113.6.123.6.133.6.143.6.153.7.03.7-dev3.7.13.7.23.7.33.7.43.7.53.7.63.7.73.7.83.7.93.7.103.7.113.7.123.7.133.7.143.7.153.7.163.7.173.8.03.8-dev3.8.13.8.23.8.33.8.43.8.53.8.63.8.73.8.83.8.93.8.103.8.113.8.123.8.133.8.143.8.153.8.163.8.173.8.183.9.03.9-dev3.9.13.9.23.9.43.9.53.9.63.9.73.9.83.9.93.9.103.9.113.9.123.9.133.9.143.9.153.9.163.9.173.9.183.10.03.10-dev3.10.13.10.23.10.33.10.43.10.53.10.63.10.73.10.83.10.93.10.103.10.113.10.123.10.133.11.03.11-dev3.11.13.11.23.11.33.11.43.11.53.11.63.11.73.12.03.12-dev3.12.13.13.0a23.13-devactivepython-2.7.14activepython-3.5.4activepython-3.6.0anaconda-1.4.0anaconda-1.5.0anaconda-1.5.1anaconda-1.6.0anaconda-1.6.1anaconda-1.7.0anaconda-1.8.0anaconda-1.9.0anaconda-1.9.1anaconda-1.9.2anaconda-2.0.0anaconda-2.0.1anaconda-2.1.0anaconda-2.2.0anaconda-2.3.0anaconda-2.4.0anaconda-4.0.0anaconda2-2.4.0anaconda2-2.4.1anaconda2-2.5.0anaconda2-4.0.0anaconda2-4.1.0anaconda2-4.1.1anaconda2-4.2.0anaconda2-4.3.0anaconda2-4.3.1anaconda2-4.4.0anaconda2-5.0.0anaconda2-5.0.1anaconda2-5.1.0anaconda2-5.2.0anaconda2-5.3.0anaconda2-5.3.1anaconda2-2018.12anaconda2-2019.03anaconda2-2019.07anaconda2-2019.10anaconda3-2.0.0anaconda3-2.0.1anaconda3-2.1.0anaconda3-2.2.0anaconda3-2.3.0anaconda3-2.4.0anaconda3-2.4.1anaconda3-2.5.0anaconda3-4.0.0anaconda3-4.1.0anaconda3-4.1.1anaconda3-4.2.0anaconda3-4.3.0anaconda3-4.3.1anaconda3-4.4.0anaconda3-5.0.0anaconda3-5.0.1anaconda3-5.1.0anaconda3-5.2.0anaconda3-5.3.0anaconda3-5.3.1anaconda3-2018.12anaconda3-2019.03anaconda3-2019.07anaconda3-2019.10anaconda3-2020.02anaconda3-2020.07anaconda3-2020.11anaconda3-2021.04anaconda3-2021.05anaconda3-2021.11anaconda3-2022.05anaconda3-2022.10anaconda3-2023.03-0anaconda3-2023.03anaconda3-2023.03-1anaconda3-2023.07-0anaconda3-2023.07-1anaconda3-2023.07-2anaconda3-2023.09-0cinder-3.8-devcinder-3.10-devgraalpy-community-23.1.0graalpy-22.3.0graalpy-23.0.0graalpy-23.1.0graalpython-20.1.0graalpython-20.2.0graalpython-20.3.0graalpython-21.0.0graalpython-21.1.0graalpython-21.2.0graalpython-21.3.0graalpython-22.0.0graalpython-22.1.0graalpython-22.2.0ironpython-devironpython-2.7.4ironpython-2.7.5ironpython-2.7.6.3ironpython-2.7.7jython-devjython-2.5.0jython-2.5-devjython-2.5.1jython-2.5.2jython-2.5.3jython-2.5.4-rc1jython-2.7.0jython-2.7.1jython-2.7.2mambaforge-pypy3mambaforgemambaforge-4.10.1-4mambaforge-4.10.1-5mambaforge-4.10.2-0mambaforge-4.10.3-0mambaforge-4.10.3-1mambaforge-4.10.3-2mambaforge-4.10.3-3mambaforge-4.10.3-4mambaforge-4.10.3-5mambaforge-4.10.3-6mambaforge-4.10.3-7mambaforge-4.10.3-8mambaforge-4.10.3-9mambaforge-4.10.3-10mambaforge-4.11.0-0mambaforge-4.11.0-1mambaforge-4.11.0-2mambaforge-4.11.0-3mambaforge-4.11.0-4mambaforge-4.12.0-0mambaforge-4.12.0-1mambaforge-4.12.0-2mambaforge-4.12.0-3mambaforge-4.13.0-1mambaforge-4.14.0-0mambaforge-4.14.0-1mambaforge-4.14.0-2mambaforge-22.9.0-0mambaforge-22.9.0-1mambaforge-22.9.0-2mambaforge-22.9.0-3micropython-devmicropython-1.9.3micropython-1.9.4micropython-1.10micropython-1.11micropython-1.12micropython-1.13micropython-1.14micropython-1.15micropython-1.16micropython-1.17micropython-1.18micropython-1.19.1miniconda-latestminiconda-2.2.2miniconda-3.0.0miniconda-3.0.4miniconda-3.0.5miniconda-3.3.0miniconda-3.4.2miniconda-3.7.0miniconda-3.8.3miniconda-3.9.1miniconda-3.10.1miniconda-3.16.0miniconda-3.18.3miniconda2-latestminiconda2-2.7-4.8.3miniconda2-3.18.3miniconda2-3.19.0miniconda2-4.0.5miniconda2-4.1.11miniconda2-4.3.14miniconda2-4.3.21miniconda2-4.3.27miniconda2-4.3.30miniconda2-4.3.31miniconda2-4.4.10miniconda2-4.5.1miniconda2-4.5.4miniconda2-4.5.11miniconda2-4.5.12miniconda2-4.6.14miniconda2-4.7.10miniconda2-4.7.12miniconda3-latestminiconda3-2.2.2miniconda3-3.0.0miniconda3-3.0.4miniconda3-3.0.5miniconda3-3.3.0miniconda3-3.4.2miniconda3-3.7.0miniconda3-3.7-4.8.2miniconda3-3.7-4.8.3miniconda3-3.7-4.9.2miniconda3-3.7-4.10.1miniconda3-3.7-4.10.3miniconda3-3.7-4.11.0miniconda3-3.7-4.12.0miniconda3-3.7-22.11.1-1miniconda3-3.7-23.1.0-1miniconda3-3.8.3miniconda3-3.8-4.8.2miniconda3-3.8-4.8.3miniconda3-3.8-4.9.2miniconda3-3.8-4.10.1miniconda3-3.8-4.10.3miniconda3-3.8-4.11.0miniconda3-3.8-4.12.0miniconda3-3.8-22.11.1-1miniconda3-3.8-23.1.0-1miniconda3-3.8-23.3.1-0miniconda3-3.8-23.5.0-3miniconda3-3.8-23.5.1-0miniconda3-3.8-23.5.2-0miniconda3-3.8-23.9.0-0miniconda3-3.8-23.10.0-1miniconda3-3.9.1miniconda3-3.9-4.9.2miniconda3-3.9-4.10.1miniconda3-3.9-4.10.3miniconda3-3.9-4.11.0miniconda3-3.9-4.12.0miniconda3-3.9-22.11.1-1miniconda3-3.9-23.1.0-1miniconda3-3.9-23.3.1-0miniconda3-3.9-23.5.0-3miniconda3-3.9-23.5.1-0miniconda3-3.9-23.5.2-0miniconda3-3.9-23.9.0-0miniconda3-3.9-23.10.0-1miniconda3-3.10.1miniconda3-3.10-22.11.1-1miniconda3-3.10-23.1.0-1miniconda3-3.10-23.3.1-0miniconda3-3.10-23.5.0-3miniconda3-3.10-23.5.1-0miniconda3-3.10-23.5.2-0miniconda3-3.10-23.9.0-0miniconda3-3.10-23.10.0-1miniconda3-3.11-23.5.0-3miniconda3-3.11-23.5.1-0miniconda3-3.11-23.5.2-0miniconda3-3.11-23.9.0-0miniconda3-3.11-23.10.0-1miniconda3-3.16.0miniconda3-3.18.3miniconda3-3.19.0miniconda3-4.0.5miniconda3-4.1.11miniconda3-4.2.12miniconda3-4.3.11miniconda3-4.3.14miniconda3-4.3.21miniconda3-4.3.27miniconda3-4.3.30miniconda3-4.3.31miniconda3-4.4.10miniconda3-4.5.1miniconda3-4.5.4miniconda3-4.5.11miniconda3-4.5.12miniconda3-4.6.14miniconda3-4.7.10miniconda3-4.7.12miniforge-pypy3miniforge3-latestminiforge3-4.9.2miniforge3-4.10miniforge3-4.10.1-1miniforge3-4.10.1-3miniforge3-4.10.1-5miniforge3-4.10.2-0miniforge3-4.10.3-0miniforge3-4.10.3-1miniforge3-4.10.3-2miniforge3-4.10.3-3miniforge3-4.10.3-4miniforge3-4.10.3-5miniforge3-4.10.3-6miniforge3-4.10.3-7miniforge3-4.10.3-8miniforge3-4.10.3-9miniforge3-4.10.3-10miniforge3-4.11.0-0miniforge3-4.11.0-1miniforge3-4.11.0-2miniforge3-4.11.0-3miniforge3-4.11.0-4miniforge3-4.12.0-0miniforge3-4.12.0-1miniforge3-4.12.0-2miniforge3-4.12.0-3miniforge3-4.13.0-0miniforge3-4.13.0-1miniforge3-4.14.0-0miniforge3-4.14.0-1miniforge3-4.14.0-2miniforge3-22.9.0-0miniforge3-22.9.0-1miniforge3-22.9.0-2miniforge3-22.9.0-3miniforge3-22.11.1-4miniforge3-23.3.1-1nogil-3.9.10nogil-3.9.10-1pypy-c-jit-latestpypy-devpypy-stm-2.3pypy-stm-2.5.1pypy-1.5-srcpypy-1.6pypy-1.7pypy-1.8pypy-1.9pypy-2.0-srcpypy-2.0pypy-2.0.1-srcpypy-2.0.1pypy-2.0.2-srcpypy-2.0.2pypy-2.1-srcpypy-2.1pypy-2.2-srcpypy-2.2pypy-2.2.1-srcpypy-2.2.1pypy-2.3-srcpypy-2.3pypy-2.3.1-srcpypy-2.3.1pypy-2.4.0-srcpypy-2.4.0pypy-2.5.0-srcpypy-2.5.0pypy-2.5.1-srcpypy-2.5.1pypy-2.6.0-srcpypy-2.6.0pypy-2.6.1-srcpypy-2.6.1pypy-4.0.0-srcpypy-4.0.0pypy-4.0.1-srcpypy-4.0.1pypy-5.0.0-srcpypy-5.0.0pypy-5.0.1-srcpypy-5.0.1pypy-5.1-srcpypy-5.1pypy-5.1.1-srcpypy-5.1.1pypy-5.3-srcpypy-5.3pypy-5.3.1-srcpypy-5.3.1pypy-5.4-srcpypy-5.4pypy-5.4.1-srcpypy-5.4.1pypy-5.6.0-srcpypy-5.6.0pypy-5.7.0-srcpypy-5.7.0pypy-5.7.1-srcpypy-5.7.1pypy2-5.3-srcpypy2-5.3pypy2-5.3.1-srcpypy2-5.3.1pypy2-5.4-srcpypy2-5.4pypy2-5.4.1-srcpypy2-5.4.1pypy2-5.6.0-srcpypy2-5.6.0pypy2-5.7.0-srcpypy2-5.7.0pypy2-5.7.1-srcpypy2-5.7.1pypy2.7-5.8.0-srcpypy2.7-5.8.0pypy2.7-5.9.0-srcpypy2.7-5.9.0pypy2.7-5.10.0-srcpypy2.7-5.10.0pypy2.7-6.0.0-srcpypy2.7-6.0.0pypy2.7-7.0.0-srcpypy2.7-7.0.0pypy2.7-7.1.0-srcpypy2.7-7.1.0pypy2.7-7.1.1-srcpypy2.7-7.1.1pypy2.7-7.2.0-srcpypy2.7-7.2.0pypy2.7-7.3.0-srcpypy2.7-7.3.0pypy2.7-7.3.1-srcpypy2.7-7.3.1pypy2.7-7.3.2-srcpypy2.7-7.3.2pypy2.7-7.3.3-srcpypy2.7-7.3.3pypy2.7-7.3.4-srcpypy2.7-7.3.4pypy2.7-7.3.5-srcpypy2.7-7.3.5pypy2.7-7.3.6-srcpypy2.7-7.3.6pypy2.7-7.3.8-srcpypy2.7-7.3.8pypy2.7-7.3.9-srcpypy2.7-7.3.9pypy2.7-7.3.10-srcpypy2.7-7.3.10pypy2.7-7.3.11-srcpypy2.7-7.3.11pypy2.7-7.3.12-srcpypy2.7-7.3.12pypy2.7-7.3.13-srcpypy2.7-7.3.13pypy3-2.3.1-srcpypy3-2.3.1pypy3-2.4.0-srcpypy3-2.4.0pypy3.3-5.2-alpha1-srcpypy3.3-5.2-alpha1pypy3.3-5.5-alpha-srcpypy3.3-5.5-alphapypy3.5-c-jit-latestpypy3.5-5.7-beta-srcpypy3.5-5.7-betapypy3.5-5.7.1-beta-srcpypy3.5-5.7.1-betapypy3.5-5.8.0-srcpypy3.5-5.8.0pypy3.5-5.9.0-srcpypy3.5-5.9.0pypy3.5-5.10.0-srcpypy3.5-5.10.0pypy3.5-5.10.1-srcpypy3.5-5.10.1pypy3.5-6.0.0-srcpypy3.5-6.0.0pypy3.5-7.0.0-srcpypy3.5-7.0.0pypy3.6-7.0.0-srcpypy3.6-7.0.0pypy3.6-7.1.0-srcpypy3.6-7.1.0pypy3.6-7.1.1-srcpypy3.6-7.1.1pypy3.6-7.2.0-srcpypy3.6-7.2.0pypy3.6-7.3.0-srcpypy3.6-7.3.0pypy3.6-7.3.1-srcpypy3.6-7.3.1pypy3.6-7.3.2-srcpypy3.6-7.3.2pypy3.6-7.3.3-srcpypy3.6-7.3.3pypy3.7-c-jit-latestpypy3.7-7.3.2-srcpypy3.7-7.3.2pypy3.7-7.3.3-srcpypy3.7-7.3.3pypy3.7-7.3.4-srcpypy3.7-7.3.4pypy3.7-7.3.5-srcpypy3.7-7.3.5pypy3.7-7.3.6-srcpypy3.7-7.3.6pypy3.7-7.3.7-srcpypy3.7-7.3.7pypy3.7-7.3.8-srcpypy3.7-7.3.8pypy3.7-7.3.9-srcpypy3.7-7.3.9pypy3.8-7.3.6-srcpypy3.8-7.3.6pypy3.8-7.3.7-srcpypy3.8-7.3.7pypy3.8-7.3.8-srcpypy3.8-7.3.8pypy3.8-7.3.9-srcpypy3.8-7.3.9pypy3.8-7.3.10-srcpypy3.8-7.3.10pypy3.8-7.3.11-srcpypy3.8-7.3.11pypy3.9-7.3.8-srcpypy3.9-7.3.8pypy3.9-7.3.9-srcpypy3.9-7.3.9pypy3.9-7.3.10-srcpypy3.9-7.3.10pypy3.9-7.3.11-srcpypy3.9-7.3.11pypy3.9-7.3.12-srcpypy3.9-7.3.12pypy3.9-7.3.13-srcpypy3.9-7.3.13pypy3.10-7.3.12-srcpypy3.10-7.3.12pypy3.10-7.3.13-srcpypy3.10-7.3.13pyston-2.2pyston-2.3pyston-2.3.1pyston-2.3.2pyston-2.3.3pyston-2.3.4pyston-2.3.5stackless-devstackless-2.7-devstackless-2.7.2stackless-2.7.3stackless-2.7.4stackless-2.7.5stackless-2.7.6stackless-2.7.7stackless-2.7.8stackless-2.7.9stackless-2.7.10stackless-2.7.11stackless-2.7.12stackless-2.7.14stackless-2.7.16stackless-3.2.2stackless-3.2.5stackless-3.3.5stackless-3.3.7stackless-3.4-devstackless-3.4.2stackless-3.4.7stackless-3.5.4stackless-3.7.5