title: Error when installing package with pip inside a venv: zipfile.BadZipFile: File is not a zip file
body: <p>I am trying to install the package ansible (version 2.9.27 specifically) on a python 3.6.8 virtual environment.
  I am getting the following error:</p>
  <pre><code>Looking in indexes: https://pypi.org/simple/
  Collecting ansible==2.9.27
    Using cached ansible-2.9.27-py3-none-any.whl
  ERROR: Exception:
  Traceback (most recent call last):
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/cli/base_command.py&quot;, line 164, in exc_logging_wrapper
      status = run_func(*args)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/cli/req_command.py&quot;, line 205, in wrapper
      return func(self, options, args)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/commands/install.py&quot;, line 339, in run
      reqs, check_supported_wheels=not options.target_dir
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py&quot;, line 93, in resolve
      collected.requirements, max_rounds=try_to_avoid_resolution_too_deep
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py&quot;, line 482, in resolve
      state = resolution.resolve(requirements, max_rounds=max_rounds)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py&quot;, line 349, in resolve
      self._add_to_criteria(self.state.criteria, r, parent=None)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py&quot;, line 173, in _add_to_criteria
      if not criterion.candidates:
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_vendor/resolvelib/structs.py&quot;, line 151, in __bool__
      return bool(self._sequence)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py&quot;, line 155, in __bool__
      return any(self)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py&quot;, line 143, in &lt;genexpr&gt;
      return (c for c in iterator if id(c) not in self._incompatible_ids)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py&quot;, line 47, in _iter_built
      candidate = func()
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py&quot;, line 206, in _make_candidate_from_link
      version=version,
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py&quot;, line 287, in __init__
      version=version,
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py&quot;, line 156, in __init__
      self.dist = self._prepare()
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py&quot;, line 225, in _prepare
      dist = self._prepare_distribution()
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py&quot;, line 292, in _prepare_distribution
      return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/operations/prepare.py&quot;, line 482, in prepare_linked_requirement
      return self._prepare_linked_requirement(req, parallel_builds)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/operations/prepare.py&quot;, line 550, in _prepare_linked_requirement
      self.build_isolation,
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/operations/prepare.py&quot;, line 59, in _get_prepared_distribution
      return abstract_dist.get_metadata_distribution()
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/distributions/wheel.py&quot;, line 26, in get_metadata_distribution
      return get_wheel_distribution(wheel, canonicalize_name(self.req.name))
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/metadata/__init__.py&quot;, line 51, in get_wheel_distribution
      return Distribution.from_wheel(wheel, canonical_name)
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/metadata/pkg_resources.py&quot;, line 37, in from_wheel
      with wheel.as_zipfile() as zf:
    File &quot;/opt/dev/automated_golive/development/custom-python3-ansible-299/lib64/python3.6/site-packages/pip/_internal/metadata/base.py&quot;, line 321, in as_zipfile
      return zipfile.ZipFile(self.location, allowZip64=True)
    File &quot;/usr/lib64/python3.6/zipfile.py&quot;, line 1131, in __init__
      self._RealGetContents()
    File &quot;/usr/lib64/python3.6/zipfile.py&quot;, line 1198, in _RealGetContents
      raise BadZipFile(&quot;File is not a zip file&quot;)
  zipfile.BadZipFile: File is not a zip file
  </code></pre>
  <p>The installation works fine for later versions of the ansible package.</p>
  <p>What's going wrong here?</p>
  <p>PS: I realize that I am trying an EOL version of Ansible on a Python version that is also no longer supported by the Ansible project.</p>