Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac install python3.6 with brew

I want to install python version 3.6. when I do brew install python it installs latest version of python i.e 3.8.

I tried below solution but it is giving me error.

brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

Error:

Error: Calling Installation of python from a GitHub commit URL is disabled! Use 'brew extract python' to stable tap on GitHub instead.

I even tried solution in this link but not working.

Also When I do:

brew search python

I don't find [email protected] init

like image 816
Avanish Tiwari Avatar asked Sep 11 '20 10:09

Avanish Tiwari


People also ask

How do I get Python 3.6 on Mac?

On MacOS, the recommended way to get Python 3. x on your machine is to use the HomeBrew utility. HomeBrew is a package manager similar to the PowerShell Gallery that allows users to download and install programs from a public repository.

How do I install a specific version of Python on Mac terminal?

As an FYI: Python 3.4. 3_2 is $ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/bd43f59bd50bb49242259f327cb6ac7a8dd59478/Formula/python3.rb and then python3. 4 -V should work. @MikeWilliamson just clone the repo and do a git log master -- Formula/python.


1 Answers

Maybe you should do pyenv to manage the different python versions.

brew install pyenv
pyenv install 3.6.5
pyenv install 3.7.4

If you want to control the shell to use different python versions, you can try this:

pyenv shell 3.6.5
like image 72
chenrui Avatar answered Oct 21 '22 16:10

chenrui