bcc
bcc copied to clipboard
cannot import name 'BPF' from 'bcc'
$ uname -a
Linux u 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ sudo apt install python3-bcc libbcc
$ cmake .. -DPYTHON_CMD=python3 -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 -DLLVM_INCLUDE_DIR=/usr/lib/llvm-14/include -DLLVM_BUILD_INCLUDE_DIR=/usr/include/llvm-14/
$ make -j12 && sudo make install
$ sudo ./execsnoop
/usr/lib/python3/dist-packages/requests/__init__.py:89:` RequestsDependencyWarning: urllib3 (1.26.5) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
File "./execsnoop", line 21, in <module>
from bcc import BPF
ImportError: cannot import name 'BPF' from 'bcc' (/usr/local/lib/python3.8/dist-packages/bcc/__init__.py)
$ python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from bcc import BPF
File "<stdin>", line 1
from bcc import BPF
^
IndentationError: unexpected indent
>>> import bcc
>>> bcc
bcc
>>> bcc.
bcc.BCC( bcc.bcc bcc.gu_bcc_indexer( bcc.np bcc.pytest
bcc.PositiveFloat( bcc.float32 bcc.guvec( bcc.numba_bcc_indexer( bcc.tl
bcc.PositiveInt( bcc.float64 bcc.jit( bcc.numpy bcc.tt
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
I get this error when running execsnoop, how can I fix it?