title: Importing Pytest fails with "AttributeError: 'str' object has no attribute 'pattern'"
body: <p>Trying to import pytest on Python 3.8 fails with the following error:</p>
  
  <pre><code>&gt;&gt;&gt; import pytest
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\pytest\__init__.py", line 6, in &lt;module&gt;
      from _pytest.assertion import register_assert_rewrite
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\assertion\__init__.py", line 7, in &lt;module&gt;
      from _pytest.assertion import rewrite
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\assertion\rewrite.py", line 24, in &lt;module&gt;
      from _pytest.assertion import util
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\assertion\util.py", line 14, in &lt;module&gt;
      import _pytest._code
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\_code\__init__.py", line 2, in &lt;module&gt;
      from .code import Code  # noqa
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\_code\code.py", line 28, in &lt;module&gt;
      import pluggy
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\__init__.py", line 16, in &lt;module&gt;
      from .manager import PluginManager, PluginValidationError
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\manager.py", line 6, in &lt;module&gt;
      import importlib_metadata
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\importlib_metadata\__init__.py", line 478, in &lt;module&gt;
      __version__ = version(__name__)
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\importlib_metadata\__init__.py", line 445, in version
      return distribution(package).version
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\importlib_metadata\__init__.py", line 418, in distribution
      return Distribution.from_name(package)
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\site-packages\importlib_metadata\__init__.py", line 179, in from_name
      dists = resolver(name)
    File "&lt;frozen importlib._bootstrap_external&gt;", line 1382, in find_distributions
    File "C:\Users\Al\AppData\Local\Programs\Python\Python38\lib\importlib\metadata.py", line 379, in find_distributions
      found = cls._search_paths(context.pattern, context.path)
  AttributeError: 'str' object has no attribute 'pattern'
  </code></pre>
  
  <p>How do I fix this?</p>