Ansible failed to import Hetzner hcloud Python library

282 Views Asked by At

Ubuntu 21.10 Ansible 2.10.8 hcloud 1.16.0 Python 3.9.7

Running an Ansible playbook on a fresh installation of Ansible and Hetzner's hcloud Python module, an error shows up and the script is aborted: Failed to import the required Python library (hcloud-python) on laptop's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter

The playbook runs perfectly fine on a MacBook Pro laptop with Ansible 2.11.1 and hcloud 1.12 (Python 3.9.5).

I haven't found much information on the Internet about this issue...

1

There are 1 best solutions below

0
Roberto Jobet On

Found the culprit... Debian (and Ubuntu) packages for ansible used to rely on python2 and that is why it will not use python3 libraries....

In fact I installed ansible using the apt install ansible command