Failed to import the required Python library (librouteros)

Hello,
I’m trying to use community.routeros.api for the first time. I’m using a venv in which I installed ansible. Hopefully, I correctly updated community.routeros to 3.19.0. in it.
When running a simple task involving community.routeros.api module, I’ve got:

[ERROR]: Task failed: Module failed: Failed to import the required Python library (librouteros)

Any idea ?

Best regards

You need to install the Python librouteros library:

Into the venv:

Also if you’re using a venv, you need to make sure that modules are actually using the venv. IIRC ansible-core doesn’t do that automatically when running modules against localhost.

1 Like