bcc icon indicating copy to clipboard operation
bcc copied to clipboard

ImportError: No module named bcc

Open LaironSk opened this issue 2 years ago • 5 comments

Hi, I'm currently trying to install bcc and failing miserably.

I'm using Ubuntu 20.04.06 abd my llvm version is 10.0.0(Eventhough when use cmake ../cmake -DPYTHON_CMD=python3 in bcc/build it tells me tthat my LLVM is 6(Found LLVM: usr/lib/llvm-6.0/include 6.0.1

I've tried to install release 0.24.0 to build bcc, it actually built, but when I'm trying to run ./execsnoop.py it returns the error:

$ ./execsnoop.py
  Traceback (mosr recent call last):
      File "./execsnoop.py", line 23, in <module>
       from bcc import BPF
        ImportError: No module named bcc

Anyone knows what is going on?

LaironSk avatar Jul 27 '23 20:07 LaironSk

Same issue encountered

Tronginx avatar Jul 27 '23 22:07 Tronginx

It seems the problem was the python version. I changed to python 3 and it worked.

LaironSk avatar Jul 27 '23 23:07 LaironSk

Had the same error, execution using python3 helped me[in case it needs privileged access, use sudo]

namishelex01 avatar Aug 06 '23 22:08 namishelex01

sry, but what do you mean by changing to python3, need to use 'sudo python3 ./execsnoop.py'?

Morpheus039 avatar Jan 18 '24 02:01 Morpheus039

sry, but what do you mean by changing to python3, need to use 'sudo python3 ./execsnoop.py'?

Sure. But for some specific situations, it will not work without any reason.

LouisLiuNova avatar Jan 19 '24 12:01 LouisLiuNova