title: Switching Python version (3.9 → 3.8) installed by Homebrew
body: <p>It’s a very similar situation like <a href="https://stackoverflow.com/questions/64362772/switching-python-version-installed-by-homebrew">described here</a>, but vice versa. I have Python 3.8 installed via Homebrew and updated that to 3.9:</p>
  <pre><code>% brew list --formula | grep python
  python@3.8
  python@3.9
  </code></pre>
  <p>I want to use Python 3.8 as my default version with <code>python3</code> command and tried – inspired by <a href="https://stackoverflow.com/a/64427919/13520223">this answer</a> – the following:</p>
  <pre><code>brew unlink python@3.9
  brew unlink python@3.8
  brew link python@3.8
  </code></pre>
  <p>The last gave me the following output:</p>
  <pre><code>% brew link python@3.8
  Linking /usr/local/Cellar/python@3.8/3.8.6_2... 
  Error: Could not symlink bin/pip3
  Target /usr/local/bin/pip3
  already exists. You may want to remove it:
    rm '/usr/local/bin/pip3'
  
  To force the link and overwrite all conflicting files:
    brew link --overwrite python@3.8
  
  To list all files that would be deleted:
    brew link --overwrite --dry-run python@3.8
  </code></pre>
  <p>So I did:</p>
  <pre><code>% brew link --overwrite --dry-run python@3.8
  Would remove:
  /usr/local/bin/pip3
  
  If you need to have this software first in your PATH instead consider running:
    echo 'export PATH=&quot;/usr/local/opt/python@3.8/bin:$PATH&quot;' &gt;&gt; ~/.zshrc
  </code></pre>
  <p>I thought it would be a good idea to check that first:</p>
  <pre><code>ralf@razbook ~ % brew link --force --dry-run python@3.8
  Would link:
  /usr/local/bin/2to3
  /usr/local/bin/2to3-3.8
  /usr/local/bin/easy_install-3.8
  /usr/local/bin/idle3
  /usr/local/bin/idle3.8
  /usr/local/bin/pip3
  /usr/local/bin/pip3.8
  /usr/local/bin/pydoc3
  /usr/local/bin/pydoc3.8
  /usr/local/bin/python3
  /usr/local/bin/python3-config
  /usr/local/bin/python3.8
  /usr/local/bin/python3.8-config
  /usr/local/bin/wheel3
  /usr/local/share/man/man1/python3.1
  /usr/local/share/man/man1/python3.8.1
  /usr/local/lib/pkgconfig/python-3.8-embed.pc
  /usr/local/lib/pkgconfig/python-3.8.pc
  /usr/local/lib/pkgconfig/python3-embed.pc
  /usr/local/lib/pkgconfig/python3.pc
  /usr/local/Frameworks/Python.framework/Headers
  /usr/local/Frameworks/Python.framework/Python
  /usr/local/Frameworks/Python.framework/Resources
  /usr/local/Frameworks/Python.framework/Versions/3.8
  /usr/local/Frameworks/Python.framework/Versions/Current
  
  If you need to have this software first in your PATH instead consider running:
    echo 'export PATH=&quot;/usr/local/opt/python@3.8/bin:$PATH&quot;' &gt;&gt; ~/.zshrc
  </code></pre>
  <p>Sounds good, so let's do it:</p>
  <pre><code> % brew link --force python@3.8 
  Linking /usr/local/Cellar/python@3.8/3.8.6_2... 
  Error: Could not symlink bin/pip3
  Target /usr/local/bin/pip3
  already exists. You may want to remove it:
    rm '/usr/local/bin/pip3'
  
  To force the link and overwrite all conflicting files:
    brew link --overwrite python@3.8
  
  To list all files that would be deleted:
    brew link --overwrite --dry-run python@3.8
  </code></pre>
  <p>Unfortunately I skipped the dry-run:</p>
  <pre><code> % brew link --overwrite python@3.8
  Linking /usr/local/Cellar/python@3.8/3.8.6_2... 25 symlinks created
  
  If you need to have this software first in your PATH instead consider running:
    echo 'export PATH=&quot;/usr/local/opt/python@3.8/bin:$PATH&quot;' &gt;&gt; ~/.zshrc
  </code></pre>
  <p>Something seems to have worked:</p>
  <pre><code>% python3 --version
  Python 3.8.6
  % pip3 --version
  pip 20.2.4 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
  </code></pre>
  <p>But still something with <code>pipenv</code> was wrong:</p>
  <pre><code>% pipenv install google-ads
  Warning: Python 3.9 was not found on your system...
  Neither 'pyenv' nor 'asdf' could be found to install Python.
  You can specify specific versions of Python with:
  $ pipenv --python path/to/python
  </code></pre>
  <p>Perhaps I simply should reinstall <code>pipenv</code>?</p>
  <pre><code>% which pipenv
  /usr/local/bin/pipenv
  
  % pip3 uninstall pipenv
  Found existing installation: pipenv 2020.8.13
  Uninstalling pipenv-2020.8.13:
    Would remove:
      /usr/local/bin/pipenv
      /usr/local/bin/pipenv-resolver
      /usr/local/lib/python3.8/site-packages/pipenv-2020.8.13.dist-info/*
      /usr/local/lib/python3.8/site-packages/pipenv/*
  Proceed (y/n)? y
    Successfully uninstalled pipenv-2020.8.13
  
  % pip3 install pipenv
  Collecting pipenv
    Downloading pipenv-2020.11.15-py2.py3-none-any.whl (3.9 MB)
       |████████████████████████████████| 3.9 MB 2.9 MB/s 
  Requirement already satisfied: pip&gt;=18.0 in /usr/local/lib/python3.8/site-packages (from pipenv) (20.2.4)
  Requirement already satisfied: virtualenv in /usr/local/lib/python3.8/site-packages (from pipenv) (20.0.31)
  Requirement already satisfied: setuptools&gt;=36.2.1 in /usr/local/lib/python3.8/site-packages (from pipenv) (50.3.2)
  Requirement already satisfied: certifi in /usr/local/lib/python3.8/site-packages (from pipenv) (2020.6.20)
  Requirement already satisfied: virtualenv-clone&gt;=0.2.5 in /usr/local/lib/python3.8/site-packages (from pipenv) (0.5.4)
  Requirement already satisfied: distlib&lt;1,&gt;=0.3.1 in /usr/local/lib/python3.8/site-packages (from virtualenv-&gt;pipenv) (0.3.1)
  Requirement already satisfied: filelock&lt;4,&gt;=3.0.0 in /usr/local/lib/python3.8/site-packages (from virtualenv-&gt;pipenv) (3.0.12)
  Collecting six&lt;2,&gt;=1.9.0
    Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
  Requirement already satisfied: appdirs&lt;2,&gt;=1.4.3 in /usr/local/lib/python3.8/site-packages (from virtualenv-&gt;pipenv) (1.4.4)
  Installing collected packages: pipenv, six
  Successfully installed pipenv-2020.11.15 six-1.15.0
  </code></pre>
  <p>But still:</p>
  <pre><code>% pipenv install google-ads
  Warning: Python 3.9 was not found on your system...
  Neither 'pyenv' nor 'asdf' could be found to install Python.
  You can specify specific versions of Python with:
  $ pipenv --python path/to/python
  </code></pre>
  <p>Actually not OK, but let's declare which Python pipenv should use:</p>
  <pre><code>% pipenv --python /usr/local/opt/python@3.8/bin/python3 install google-ads
  Creating a virtualenv for this project...
  Pipfile: /Users/ralf/code/test_snippets/20-12-10_google_ads/Pipfile
  Using /usr/local/opt/python@3.8/bin/python3 (3.8.6) to create virtualenv...
  ⠦ Creating virtual environment...created virtual environment CPython3.8.6.final.0-64 in 362ms
    creator CPython3Posix(dest=/Users/ralf/.local/share/virtualenvs/20-12-10_google_ads-S7vGVfKj, clear=False, global=False)
    seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/ralf/Library/Application Support/virtualenv)
      added seed packages: pip==20.2.4, setuptools==50.3.2, wheel==0.35.1
    activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
  
  ✔ Successfully created virtual environment! 
  Virtualenv location: /Users/ralf/.local/share/virtualenvs/20-12-10_google_ads-S7vGVfKj
  Warning: Your Pipfile requires python_version 3.9, but you are using 3.8.6 (/Users/ralf/.local/share/v/2/bin/python).
    $ pipenv --rm and rebuilding the virtual environment may resolve the issue.
    $ pipenv check will surely fail.
  Warning: Your Pipfile requires python_version 3.9, but you are using 3.8.6 (/Users/ralf/.local/share/v/2/bin/python).
    $ pipenv --rm and rebuilding the virtual environment may resolve the issue.
    $ pipenv check will surely fail.
  Installing google-ads...
  </code></pre>
  <p><code>pipenv --rm</code> and rebuilding the virtual environment did not help. (I even consider to simply uninstall Python 3.9 and installing Python 3.8 again – but <a href="https://stackoverflow.com/questions/65336057/does-simply-uninstalling-python-3-9-and-installing-python-3-8-again-with-homebre">don't know how</a>.)</p>
  <p><strong>Is there a way to persuade pipenv of using Python 3.8?</strong></p>