community / community.general / 6.6.8 / module / python_requirements_info Show python path and assert dependency versions Authors: Will Thames (@willthames), Ryan Scott Brown (@ryansb)community.general.python_requirements_info (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
Get info about available Python requirements on the target host, including listing required libraries and gathering versions.
This module was called C(python_requirements_facts) before Ansible 2.9. The usage did not change.
- name: Show python lib/site paths community.general.python_requirements_info:
- name: Check for modern boto3 and botocore versions community.general.python_requirements_info: dependencies: - boto3>1.6 - botocore<2
dependencies: default: [] description: 'A list of version-likes or module names to check for installation. Supported operators: <, >, <=, >=, or ==. The bare module name like I(ansible), the module with a specific version like I(boto3==1.6.1), or a partial version like I(requests>2) are all valid specifications. ' elements: str type: list
mismatched: description: A dictionary of dependencies that did not satisfy the desired version returned: always sample: botocore: desired: botocore>2 installed: 1.10.60 type: dict not_found: description: A list of packages that could not be imported at all, and are not installed returned: always sample: - boto4 - requests type: list python: description: path to python version used returned: always sample: /usr/local/opt/python@2/bin/python2.7 type: str python_system_path: description: List of paths python is looking for modules in returned: always sample: - /usr/local/opt/python@2/site-packages/ - /usr/lib/python/site-packages/ type: list python_version: description: version of python returned: always sample: 2.7.15 (default, May 1 2018, 16:44:08) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] type: str python_version_info: contains: major: description: The C(major) component of the python interpreter version. returned: always sample: 3 type: int micro: description: The C(micro) component of the python interpreter version. returned: always sample: 10 type: int minor: description: The C(minor) component of the python interpreter version. returned: always sample: 8 type: int releaselevel: description: The C(releaselevel) component of the python interpreter version. returned: always sample: final type: str serial: description: The C(serial) component of the python interpreter version. returned: always sample: 0 type: int description: breakdown version of python returned: always type: dict version_added: 4.2.0 version_added_collection: community.general valid: description: A dictionary of dependencies that matched their desired versions. If no version was specified, then I(desired) will be null returned: always sample: boto3: desired: null installed: 1.7.60 botocore: desired: botocore<2 installed: 1.10.60 type: dict