18

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 python@3.6 init

Avanish Tiwari
  • 201
  • 1
  • 2
  • 10
  • Have you tried this? https://stackoverflow.com/questions/51726203/installing-python3-6-alongside-python3-7-on-mac – s3cret Sep 11 '20 at 10:58

1 Answers1

38

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
chenrui
  • 8,910
  • 3
  • 33
  • 43
  • 6
    I can't figure out why this step fails for me with the following error. BUILD FAILED (OS X 11.4 using python-build 20180424) Inspect or clean up the working tree at /var/folders/5q/x_5xtv2x6kn8qwdwmgll08nh0000gp/T/python-build.20210715111610.57131 .... – SriniMurthy Jul 15 '21 at 18:21