### Summary

I am working with @lowlydba on an [MSSQL-focused collection](https://github.com/LowlyDBA/lowlydba.sqlserver), and we're getting the basics set up.

We have hit the following error in the sanity tests for Ansible 2.12 and higher:

```
Running sanity test "validate-modules"
ERROR: Command "/root/.ansible/test/venv/sanity.validate-modules/3.9/2e4ce301/bin/python /root/ansible/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate-modules --format json --arg-spec plugins/modules/memory.ps1 plugins/modules/memory.py --collection ansible_collections/lowlydba/sqlserver --collection-version 0.0.0" returned exit status 0.
>>> Standard Error
[WARNING]: packaging Python module unavailable; unable to validate collection
Ansible version requirements
>>> Standard Output
{}
```

This looks a lot like https://github.com/ansible/ansible/pull/76513 and https://github.com/ansible/ansible/issues/76504 , but is still happening in `devel` and `milestone` too.

We have been troubleshooting it in https://github.com/LowlyDBA/lowlydba.sqlserver/issues/6 and have found the following:
- Error goes away if there are no PowerShell modules present (the collection will be entirely PowerShell modules at this time)
- Error goes away if `requires_ansible` is not present in `meta/runtime.yml`
- Error goes away if a python module is included in the collection (a python plugin was not sufficient, tested with a filter plugin)


### Issue Type

Bug Report

### Component Name

ansible-test

### Ansible Version

Affects `stable-2.12`, `milestone`, and `devel` branches.

### Configuration

```console
$ ansible-config dump --only-changed
n/a
```


### OS / Environment

WSL2 / Ubuntu 18.04

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
With [the collection](https://github.com/LowlyDBA/lowlydba.sqlserver) checked out in the right directory structure: 
```yaml (paste below)
ansible-test sanity --docker default
```


### Expected Results

Clean run

### Actual Results

```console
Running sanity test "validate-modules"
ERROR: Command "/root/.ansible/test/venv/sanity.validate-modules/3.9/2e4ce301/bin/python /root/ansible/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate-modules --format json --arg-spec plugins/modules/memory.ps1 plugins/modules/memory.py --collection ansible_collections/lowlydba/sqlserver --collection-version 0.0.0" returned exit status 0.
>>> Standard Error
[WARNING]: packaging Python module unavailable; unable to validate collection
Ansible version requirements
>>> Standard Output
{}
ERROR: Command "docker exec -it ansible-test-controller-EL88bWob /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/lowlydba/sqlserver LC_ALL=en_US.UTF-8 /usr/bin/python3.9 /root/ansible/bin/ansible-test sanity --containers '{"control": {"__pypi_proxy__": {"pypi-test-container-EL88bWob": {"host_ip": "172.17.0.2", "names": ["pypi-test-container-EL88bWob"], "ports": [3141]}}}, "managed": {"__pypi_proxy__": {"pypi-test-container-EL88bWob": {"host_ip": "172.17.0.2", "names": ["pypi-test-container-EL88bWob"], "ports": [3141]}}}}' --metadata tests/output/.tmp/metadata-s3jmdrvh.json --truncate 198 --color yes --host-path tests/output/.tmp/host-zpgh4g5o" returned exit status 1.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
#
#
#
#
from __future__ import annotations
import abc
import argparse
import ast
import datetime
import json
import errno
import os
import re
import subprocess
import sys
import tempfile
import traceback
from collections import OrderedDict
from contextlib import contextmanager
from ansible.module_utils.compat.version import StrictVersion, LooseVersion
from fnmatch import fnmatch
import yaml
from ansible import __version__ as ansible_version
from ansible.executor.module_common import REPLACER_WINDOWS, NEW_STYLE_PYTHON_MODULE_RE
from ansible.module_utils.common._collections_compat import Mapping
from ansible.module_utils.common.parameters import DEFAULT_TYPE_VALIDATORS
from ansible.plugins.loader import fragment_loader