Unable to open module modpython #870

Closed
opened 2026-10-05 04:49:31 +02:00 by adam · 5 comments
Owner

I have compiled the latest ZNC (1.7.1 as of now) from the source tarball with the following configure options:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig python_LIBS="-L/usr/local/lib/ -lpython3.6m -lutil" ../configure --enable-python

Which results in:

ZNC 1.7.1 configured

prefix:       /usr/local
debug:        no
ipv6:         yes
openssl:      yes
dns:          threads
perl:         no
python:       yes
swig:         not needed
cyrus:        no
tcl:          no
charset:      yes
zlib:         yes
run from src: no

Now you can run "make" to compile ZNC

When I go to load any of my python modules in IRC (which don't even show up in the web control panel or when doing /znc listmods) located in /home/znc/.znc/modules/ I get an error:

/znc loadmod modpython
Unable to load modpython: Unable to open module modpython: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

/znc loadmod mymodule
Unable to load mymodule: Unable to find module mymodule.

I have no idea where it's looking for the modules, or shared library or why it can't find it, although I've exhausted most of obvious things I know of and would appreciate if someone could help me resolve this issue. If you need any additional information about the install, etc. please just let me know - thanks.

I have compiled the latest ZNC (1.7.1 as of now) from the source tarball with the following configure options: ``` PKG_CONFIG_PATH=/usr/local/lib/pkgconfig python_LIBS="-L/usr/local/lib/ -lpython3.6m -lutil" ../configure --enable-python ``` Which results in: ``` ZNC 1.7.1 configured prefix: /usr/local debug: no ipv6: yes openssl: yes dns: threads perl: no python: yes swig: not needed cyrus: no tcl: no charset: yes zlib: yes run from src: no Now you can run "make" to compile ZNC ``` When I go to load any of my python modules in IRC (which don't even show up in the web control panel or when doing `/znc listmods`) located in `/home/znc/.znc/modules/` I get an error: ``` /znc loadmod modpython Unable to load modpython: Unable to open module modpython: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory /znc loadmod mymodule Unable to load mymodule: Unable to find module mymodule. ``` I have no idea where it's looking for the modules, or shared library or why it can't find it, although I've exhausted most of obvious things I know of and would appreciate if someone could help me resolve this issue. If you need any additional information about the install, etc. please just let me know - thanks. <!-- github-sync-id:363644609 -->
adam closed this issue 2026-10-05 04:49:31 +02:00
Author
Owner

Show your /etc/ld.so.conf and /etc/ld.so.conf.d/*

Show your `/etc/ld.so.conf` and `/etc/ld.so.conf.d/*` <!-- github-comment-id:424422892 -->
Author
Owner

/etc/ld.so.conf

# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf

/etc/ld.so.conf.d/*

# cat /etc/ld.so.conf.d/*
/usr/lib64/dyninst
# Placeholder file, no vDSO hwcap entries used in this kernel.
/usr/lib64/llvm
/usr/lib64/mysql
**/etc/ld.so.conf** ``` # cat /etc/ld.so.conf include ld.so.conf.d/*.conf ``` **/etc/ld.so.conf.d/*** ``` # cat /etc/ld.so.conf.d/* /usr/lib64/dyninst # Placeholder file, no vDSO hwcap entries used in this kernel. /usr/lib64/llvm /usr/lib64/mysql ``` <!-- github-comment-id:424450621 -->
Author
Owner

You'll need to add /usr/local/lib there.

You'll need to add `/usr/local/lib` there. <!-- github-comment-id:424479507 -->
Author
Owner

@DarthGandalf, Thank you very much! That did the trick.

One more question (off-topic from this issue), I compiled ZNC with ICU, although when I look in the web control panel I get:

Client encoding: ZNC is compiled without encodings support. ICU is required for it.  
(  ) Don't ensure any encoding at all (legacy mode, not recommended) 
(  ) Try to parse as UTF-8 and as, send as UTF-8 (recommended) 
(  ) Try to parse as UTF-8 and as, send as Parse and send as only E.g. UTF-8, or ISO-8859-15

I'm not sure if I failed to include something during compilation perhaps, is related to not having the path /usr/local/lib inld.so.conf, or maybe this is normal? I'm just not sure which option to select or if I should recompile with some other option. Thanks again :)

@DarthGandalf, **Thank you very much!** _That did the trick._ One more question (off-topic from this issue), I compiled ZNC with ICU, although when I look in the web control panel I get: ``` Client encoding: ZNC is compiled without encodings support. ICU is required for it. ( ) Don't ensure any encoding at all (legacy mode, not recommended) ( ) Try to parse as UTF-8 and as, send as UTF-8 (recommended) ( ) Try to parse as UTF-8 and as, send as Parse and send as only E.g. UTF-8, or ISO-8859-15 ``` I'm not sure if I failed to include something during compilation perhaps, is related to not having the path `/usr/local/lib` in`ld.so.conf`, or maybe this is normal? I'm just not sure which option to select or if I should recompile with some other option. Thanks again :) <!-- github-comment-id:424518559 -->
Author
Owner

That look like you have 2 different ZNCs installed. And you are using not the one you compiled.
Check /msg *status version.

That look like you have 2 different ZNCs installed. And you are using not the one you compiled. Check `/msg *status version`. <!-- github-comment-id:424520490 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#870