Error using ctypes.cdll.LoadLibrary()

11 views
Skip to first unread message

Jerome Ibanes

unread,
Sep 29, 2020, 3:33:19 AM9/29/20
to PyInstaller
Platform: Linux-4.19.128-x86_64-with-debian-10.5

I'm getting this traceback when running the binary generated:

Traceback (most recent call last):
File "server.py", line 174, in <module>
main() File "server.py", line 147, in main
libk = ctypes.cdll.LoadLibrary("libabc.so")
File "ctypes/__init__.py", line 442, in LoadLibrary
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 149, in __init__
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 135, in _frozen_name
AttributeError: 'function' object has no attribute 'path' [575]
Failed to execute script server

command: pyinstaller --noconfirm --add-binary "libabc.so:." -F server.py

server.py contains:

(line 147) libabc = ctypes.cdll.LoadLibrary("libabc.so")
(line 148) libabc.init()

so I read the docs ( https://pyinstaller.readthedocs.io/en/v3.6/feature-notes.html ), and it says it can't contain a path, but it isn't a path, it's just the name of a file which I include with --add-binary to pyinstaller; could you advise me on how to use cdll.LoadLibrary() with a shared object from within pyinstaller?

Thanks for looking!
Reply all
Reply to author
Forward
0 new messages