iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.47k stars 3.87k forks source link

python import bcc error: undefined symbol: bpf_lookup_and_delete_batch #4302

Open QGB opened 1 year ago

QGB commented 1 year ago
root@ubuntu:/home/qgb/github/ProcMon-for-Linux/build/_deps/bcc-src/src/python# /root/anaconda3/bin/python
Python 3.8.5 (default, Sep  4 2020, 07:30:14)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bcc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/qgb/github/ProcMon-for-Linux/build/_deps/bcc-src/src/python/bcc/__init__.py", line 27, in <module>
    from .libbcc import lib, bcc_symbol, bcc_symbol_option, bcc_stacktrace_build_id, _SYM_CB_TYPE
  File "/home/qgb/github/ProcMon-for-Linux/build/_deps/bcc-src/src/python/bcc/libbcc.py", line 86, in <module>
    lib.bpf_lookup_and_delete_batch.restype = ct.c_int
  File "/root/anaconda3/lib/python3.8/ctypes/__init__.py", line 394, in __getattr__
    func = self.__getitem__(name)
  File "/root/anaconda3/lib/python3.8/ctypes/__init__.py", line 399, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libbcc.so.0: undefined symbol: bpf_lookup_and_delete_batch
QGB commented 1 year ago

/usr/lib/python2.7/dist-packages/bcc/libbcc.py

QGB commented 1 year ago

root@ubuntu:/tmp# python -V
Python 2.7.17

root@ubuntu:/tmp# python -m bcc
/usr/bin/python: No module named bcc.__main__; 'bcc' is a package and cannot be directly executed

root@ubuntu:/tmp# python /home/qgb/github/ProcMon-for-Linux/build/_deps/bcc-src/tools/execsnoop.py
Traceback (most recent call last):
  File "/home/qgb/github/ProcMon-for-Linux/build/_deps/bcc-src/tools/execsnoop.py", line 22, in <module>
    from bcc.containers import filter_by_containers
ImportError: No module named containers