title: How can I use brew and install precommit for Python 3.6.8
body: <p>I want to use <strong>brew to install pre-commit for python 3.6.8</strong>.  I am using macOS Catalina (Version 10.15.7)</p>
  <p>I am using <code>brew install pre-commit</code> to do the installation.</p>
  <p>I am having issues because my pre-commit uses Python 3.9 and I want to avoid this (i.e. make brew pre-commit use python 3.6).</p>
  <p>When I try <code>brew install pre-commit</code>, I find that automatically one sees the message <code>Downloading https://homebrew.bintray.com/bottles/python%403.9-3.9.0_2.catalina.bottle.tar.gz</code>.</p>
  <p>The environment that I am on is python 3.6.8. ( <code>python -V</code> returns <code>python 3.6.8</code>).</p>
  <p>Also,</p>
  <pre><code>username@USERNAME-M-F1AU % echo &quot;$PATH&quot; 
  /Users/username/.pyenv/shims:/Users/username/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  </code></pre>
  <p>I also have, python 3.9 (<code>python@3.9</code>), (although it is not the active environment) in <code>/usr/local/Cellar</code>. I also have a folder for <code>pre-commit</code> inside <code>/usr/local/Cellar</code>. Some paths inside subfolders which are inside <code>/usr/local/Cellar/pre-commit</code> are linked to python 3.9. Following are examples of the same.</p>
  <pre><code>python3 -&gt; ../../../../../opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9
  python -&gt; ../../../../../opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9
  </code></pre>
  <p>The first line of <code>/usr/local/bin/pre-commit</code> is:</p>
  <p><code>#!/usr/local/Cellar/pre-commit/2.9.0/libexec/bin/python</code></p>
  <p>I have tried the following already:</p>
  <ul>
  <li>Change of Python environment to Python 3.6. Issue was not solved here (symlinks of pre-commit with python 3.9)</li>
  <li>Deletion of cache (<code>rm -r /Users/username/.cache/pre-commit</code>). Same thing happened here (symlinks of pre-commit with python 3.9 still existed).</li>
  <li>Installing of precommit again (<code>rm -r /usr/local/Cellar/pre-commit</code> followed by <code>brew install pre-commit</code>). Same thing happened here (symlinks of pre-commit with python 3.9).</li>
  <li>Removing and readjusting symlinks using the method shown below.</li>
  </ul>
  <pre><code>ln -nfs /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /usr/local/Cellar/pre-commit/2.9.0/libexec/bin/python
  ln -nfs /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /usr/local/Cellar/pre-commit/2.9.0/libexec/bin/python3
  </code></pre>
  <p>Here, I got the following error <code>/usr/local/Cellar/pre-commit/2.9.0/libexec/bin/python3: No module named pre_commit</code></p>
  <p><strong>What is the best way in which I can use brew to install pre-commit such that it uses python 3.6 and not python 3.9?</strong></p>
  <p>I saw <a href="https://formulae.brew.sh/formula/pre-commit" rel="nofollow noreferrer">this brew precommit page</a>. It looks like <code>brew install pre-commit</code> automatically always uses python 3.9.0.</p>
  <p>Any help will be appreciated.</p>