close

How can I install a previous version of Python 3 in macOS using homebrew?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How can I install a previous version of Python 3 in macOS using homebrew in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How can I install a previous version of Python 3 in macOS using homebrew?

  1. How can I install a previous version of Python 3 in macOS using homebrew?

    I have tried everything but could not make it work. Finally I have used pyenv and it worked directly like a charm.

  2. I install a previous version of Python 3 in macOS using homebrew

    I have tried everything but could not make it work. Finally I have used pyenv and it worked directly like a charm.

Method 1

To make a clean install of Python 3.6.5 use:

brew unlink python # ONLY if you have installed (with brew) another version of python 3
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

If you prefer to recover a previously installed version, then:

brew info python           # To see what you have previously installed
brew switch python 3.x.x_x # Ex. 3.6.5_1

Method 2

I have tried everything but could not make it work. Finally I have used pyenv and it worked directly like a charm.

So having homebrew installed, juste do:

brew install pyenv
pyenv install 3.6.5

to manage virtualenvs:

brew install pyenv-virtualenv
pyenv virtualenv 3.6.5 env_name

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read