Installing Python 3.5.6.1: python contains a recursive dependency on itself: I am trying to install Python 3.5.6.1 with:

$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
$ brew switch python 3.6.5_1


But this gives the following error:

==&gt; Consider using `brew extract python ...`!
This will extract your desired python version to a stable tap instead of
installing from an unstable URL!

######################################################################## 100.0%
Error: python contains a recursive dependency on itself:
  python depends on sphinx-doc
  sphinx-doc depends on python


How can I install it ?
You can download any python version directly from the python website and install it manually. As you're trying to use a specific version, I'm guessing that you're not planning on upgrading it later. That way you can keep both versions if you want.