title: How to reinstall python@2 from Homebrew?
body: <p>I have been having issues with openssl and python@2 with brew, <a href="https://stackoverflow.com/questions/60229970/aws-cli-errorrootcode-for-hash-md5-was-not-found">which have explained here (unresolved)</a>. The documented workaround to reinstall Python and openssl was not working, so I decided I would uninstall and reinstall Python.</p>
  <p>The problem is, when you try to install Python 2 with brew, you receive this message:</p>
  <pre><code>brew install python@2
  Error: No available formula with the name &quot;python@2&quot;
  ==&gt; Searching for a previously deleted formula (in the last month)...
  Warning: homebrew/core is shallow clone. To get complete history run:
    git -C &quot;$(brew --repo homebrew/core)&quot; fetch --unshallow
  
  python@2 was deleted from homebrew/core in commit 028f11f9e:
    python@2: delete (https://github.com/Homebrew/homebrew-core/issues/49796)
    EOL 1 January 2020.
    We gave it 1 month more to live so that people had time to migrate.
    All in all, developers had 11 years to do their migration.
    You can use the `brew extract` command and maintain python@2 in your own
    tap if necessary:
    https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
  
  To show the formula before removal run:
    git -C &quot;$(brew --repo homebrew/core)&quot; show 028f11f9e^:Formula/python@2.rb
  
  If you still use this formula consider creating your own tap:
    https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
  </code></pre>
  <p>Unfortunately I still have a number of brew formulas that depend on Brew's python@2. Those include <code>awscli</code>, <code>letsencrypt</code>, pr <code>sshuttle</code> for example</p>
  <pre><code>aws
  zsh: /usr/local/bin/aws: bad interpreter: /usr/local/opt/python@2/bin/python2.7: no such file or directory
  </code></pre>
  <p>I don't know how to use this <code>brew extract</code> command they documented to reinstall Python@2. It needs a formula and a tap. I imagine the formula would be <code>python@2</code>. I'm not sure what the tap would need to be.</p>
  <p>Additionally reinstalling the taps such as <code>aws</code> or <code>letsencrypt</code> is not working very well either.</p>
  <p>After reinstalling <code>awscli</code> (<code>brew reinstall awscli</code>), running aws commands still gives errors.</p>
  <pre><code>aws
  /usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: &quot;is&quot; with a literal. Did you mean &quot;==&quot;?
    if x is 0 or x is 1:
  /usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: &quot;is&quot; with a literal. Did you mean &quot;==&quot;?
    if x is 0 or x is 1:
  /usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: &quot;is&quot; with a literal. Did you mean &quot;==&quot;?
    elif y is 0 or y is 1:
  /usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: &quot;is&quot; with a literal. Did you mean &quot;==&quot;?
    elif y is 0 or y is 1:
  /usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: &quot;is&quot; with a literal. Did you mean &quot;==&quot;?
    if original_result is 0:
  usage: aws [options] &lt;command&gt; &lt;subcommand&gt; [&lt;subcommand&gt; ...] [parameters]
  To see help text, you can run:
  
    aws help
    aws &lt;command&gt; help
    aws &lt;command&gt; &lt;subcommand&gt; help
  aws: error: the following arguments are required: command
  </code></pre>