karpierz / libpcap

Python binding for the libpcap C library.
BSD 3-Clause "New" or "Revised" License
54 stars 14 forks source link

No libpcap.so when installed through pip #2

Closed denravonska closed 4 years ago

denravonska commented 4 years ago

I just installed libpcap using pip and get the following:

File "workdir/env/lib/python3.8/site-packages/pcaprecorder/pcaprecorder.py", line 14, in import libpcap File "workdir/env/lib/python3.8/site-packages/libpcap/init.py", line 7, in from ._pcap import * File "workdir/env/lib/python3.8/site-packages/libpcap/_pcap.py", line 75, in from ._dll import dll File "workdir/env/lib/python3.8/site-packages/libpcap/_dll.py", line 10, in raise exc File "workdir/env/lib/python3.8/site-packages/libpcap/_dll.py", line 8, in dll = DLL(DLL_PATH) File "/usr/lib/python3.8/ctypes/init.py", line 373, in init self._handle = _dlopen(self._name, mode) OSError: workdir/env/lib/python3.8/site-packages/libpcap/_platform/_linux/x64/tcpdump/libpcap.so: cannot open shared object file: No such file or directory

When I browse the source on Github I can see that the file is included, and symlinking it to my system library seems to work. Is the intention that the library should be included when installing through pip?

You do mention this library in the doc but it's unclear if it concerns me as a user, or if it's aimed at distribution maintainers:

Note to Linux distributions and *BSD systems that include libpcap:

There's now a rule to make a shared library, which should work on Linux and *BSD, among other platforms.

It sets the soname of the library to "libpcap.so.1"; this is what it should be, NOT libpcap.so.1.x or libpcap.so.1.x.y or something such as that.

We've been maintaining binary compatibility between libpcap releases for quite a while; there's no reason to tie a binary linked with libpcap to a particular release of libpcap.

karpierz commented 4 years ago

Thank you very much @msrst !