FS#74221 - [ansible-lint] ModuleNotFoundError: No module named 'ansible_compat'

Attached to Project: Community Packages
Opened by Simon Tunnat (imon) - Thursday, 24 March 2022, 07:24 GMT
Last edited by freswa (frederik) - Thursday, 24 March 2022, 11:58 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To freswa (frederik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
Executing "ansible-lint" or even "ansible-lint --version" crashes with the following error:


Traceback (most recent call last):
File "/usr/bin/ansible-lint", line 5, in <module>
from ansiblelint.__main__ import _run_cli_entrypoint
File "/usr/lib/python3.10/site-packages/ansiblelint/__main__.py", line 33, in <module>
from ansible_compat.config import ansible_version
ModuleNotFoundError: No module named 'ansible_compat'


Additional info:
* ansible-lint 6.0.2-1
* ansible-core 2.12.3-1

Steps to reproduce:
Update to "ansible-lint" version 6.0.2 and execute it.

I do not have the full "ansible" package installed, but even installing that did not change the error message.

Downgrading to "ansible-lint" version 5.4.0-1 fixed the error.
This task depends upon

Closed by  freswa (frederik)
Thursday, 24 March 2022, 11:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  ansible-lint-6.0.2-2
Comment by Simon Tunnat (imon) - Thursday, 24 March 2022, 07:28 GMT
Strange I found a package named "python-ansible-compat". After I installed that "ansible-lint" 6.0.2 just worked.

But the packages is not marked as a dependency of "ansible-lint"....
Comment by freswa (frederik) - Thursday, 24 March 2022, 10:44 GMT
Can't reproduce. I've got ansible, ansible-core and ansible-lint installed and running it on our infra repo works fine. Do you have example code to reproduce?
Comment by Simon Tunnat (imon) - Thursday, 24 March 2022, 11:13 GMT
Did you see my last comment?

It happens in any folder when I execute "ansible-lint --version". It does not need to be a Ansible repository.

It works fine if I install "python-ansible-compat".

Loading...