mailcow / mailcow-ansiblerole

The official ansible role to setup mailcow using Ansible
GNU General Public License v3.0
75 stars 49 forks source link

Failed to import the required Python library (netaddr) #46

Closed thwint closed 7 months ago

thwint commented 7 months ago

When running the mailcow-ansiblerole on Ubuntu 22.04 I receive the following error:

fatal: [redacted]: FAILED! => {"msg": "Failed to import the required Python library (netaddr) on <redacted>'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"}

This occurs after setting mailcow__config_http_bind: 127.0.0.1. It seems to be caused by line 26 in mailcowconf.yml.

No matter if I install netaddr using apt install python3-netaddr or pipx install netaddr the error remains.

I did not override ansible_python_interpreter.

thwint commented 7 months ago

I finally found the cause of the problem. I am using Semaphore in a docker container. In there the netaddr module was not installed. Using pip install netaddrinside the container solved the problem.