pythonmod failed to init modules

Bino Oetomo wowon01 at gmail.com
Sun Sep 14 10:35:51 UTC 2025


I just clone unbound repo.

do configure with:
```
./configure \
--build=x86_64-linux-gnu \
--prefix=/usr \
--includedir=${prefix}/include \
--mandir=${prefix}/share/man \
--infodir=${prefix}/share/info \
--sysconfdir=/etc \
--localstatedir=/var \
--libdir=${prefix}/lib/x86_64-linux-gnu \
--runstatedir=/run \
--with-pythonmodule \
--with-pyunbound \
--enable-subnet \
--enable-dnstap \
--enable-systemd \
--with-chroot-dir= \
--with-dnstap-socket-path=/run/dnstap.sock \
--with-pidfile=/run/unbound.pid \
--with-libevent \
--enable-tfo-client \
--with-rootkey-file=/usr/share/dns/root.key \
--enable-tfo-server
```

make, and make install

unbound -V, gave me:
```
Version 1.24.0

Configure line: --build=x86_64-linux-gnu --prefix=/usr
--includedir=/include --mandir=/share/man --infodir=/share/info
--sysconfdir=/etc --localstatedir=/var --libdir=/lib/x86_64-linux-gnu
--runstatedir=/run --with-pythonmodule --with-pyunbound --enable-subnet
--enable-dnstap --enable-systemd --with-chroot-dir=
--with-dnstap-socket-path=/run/dnstap.sock --with-pidfile=/run/unbound.pid
--with-libevent --enable-tfo-client
--with-rootkey-file=/usr/share/dns/root.key --enable-tfo-server
Linked libs: libevent 2.1.12-stable (it uses epoll), OpenSSL 3.0.17 1 Jul
2025
Linked modules: dns64 python subnetcache respip validator iterator
TCP Fastopen feature available

BSD licensed, see LICENSE in source package for details.
Report bugs to unbound-bugs at nlnetlabs.nl or
https://github.com/NLnetLabs/unbound/issues

```

my unbound.conf lookslike:
```
server:
    # The following line will configure unbound to perform cryptographic
    # DNSSEC validation using the root trust anchor.
    auto-trust-anchor-file: "/var/lib/unbound/root.key"
    module-config: "validator python iterator"
    verbosity: 4

python:
    python-script: "/etc/unbound/helloworld.py"

remote-control:
  control-enable: yes
  # by default the control interface is is 127.0.0.1 and ::1 and port 8953
  # it is possible to use a unix socket too
  control-interface: /run/unbound.ctl

```

but
```
```

gave me:
```
...
[1757845685] unbound[86672:0] notice: init module 1: python
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'unboundmodule'
[1757845685] unbound[86672:0] error: pythonmod: cannot initialize core
module: unboundmodule.py
[1757845685] unbound[86672:0] error: module init for module python failed
[1757845685] unbound[86672:0] fatal error: failed to init modules

```

please tell me how to compile unbound the rightway so ready for python
module

-wowon-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20250914/11e8e106/attachment.htm>


More information about the Unbound-users mailing list