After building BCC from source and running the test "sudo /usr/share/bcc/tools/execsnoop", I got the following output:
Traceback (most recent call last): File "/usr/share/bcc/tools/execsnoop", line 21, in from bcc import BPF ImportError: No module named bcc
What does this mean and what can be done to remedy it?
After installing the dependencies, these are the steps that I followed:
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
# python2 can be substituted here, depending on your environment
cmake -DPYTHON_CMD=python3 ..
make && sudo make install
sudo /usr/share/bcc/tools/execsnoop #Test
this is caused due to python2 is set as default python.
there is one way to change all occurrences of
#!/usr/bin/python
to#!/usr/bin/python3
or
or
which will change python to alternatives python