iovisor / bcc

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

ImportError: cannot import name 'BPF' from 'bcc' (unknown location) #4972

Open NobinPegasus opened 5 months ago

NobinPegasus commented 5 months ago

I have built bcc from source. The directory where it was built was: /home/pegasus_vm/Documents/eBPFShield/bcc/build When I try to run python main.py -h It throws the following error: ImportError: cannot import name 'BPF' from 'bcc' (unknown location) How to fix it?

I've also added bpf build to the path like this in ~/.bashrc:

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