[Python] ImportError: cannot import name 'BPF' from 'bcc' (unknown location)

Discussão em 'Python' iniciado por Stack, Maio 13, 2025.

  1. Stack

    Stack Membro Participativo

    My bcc is build here:

    /home/pegasus_vm/Documents/eBPFShield/bcc/build


    Why I try to run python main.py -h from /home/pegasus_vm/Documents/eBPFShield/ It shows the following error:

    (env) pegasus_vm@pegasusvm:~/Documents/eBPFShield$ python main.py -h
    Traceback (most recent call last):
    File "/home/pegasus_vm/Documents/eBPFShield/main.py", line 3, in <module>
    from bcc import BPF
    ImportError: cannot import name 'BPF' from 'bcc' (unknown location)


    I have added the bcc to the path inside ~/.bashrc like this:

    bcctools=/home/pegasus_vm/Documents/eBPFShield/bcc/build/tools
    bccexamples=/home/pegasus_vm/Documents/eBPFShield/bcc/build/examples
    export PATH=$bcctools:$bccexamples:$PATH

    Continue reading...

Compartilhe esta Página