Skip to content

ImportError: cannot import name BPF #2278

@britchey80

Description

@britchey80

4.9.0-8-amd64 #1 SMP Debian 4.9.144-3 (2019-02-02) x86_64 GNU/Linux

After following the installation instructions for Debian here:
https://github.com/iovisor/bcc/blob/master/INSTALL.md#debian---source

I am unable to run any of the tools. They all fail with the error message:

from bcc import BPF
ImportError: cannot import name 'BPF'

Here are my current kernel BPF configs:

cat /boot/config-4.9.0-8-amd64 | grep BPF
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
# CONFIG_BPF_JIT_ALWAYS_ON is not set
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NET_CLS_BPF=m
CONFIG_NET_ACT_BPF=m
CONFIG_BPF_JIT=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_BPF_EVENTS=y
CONFIG_TEST_BPF=m

Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions