blob: 83b66ebdd3ac5ad91a76b9ca1416fef77251b999 [file] [log] [blame]
Alexei Starovoitov0d056572015-06-09 20:36:56 -07001Q: while running 'make test' I'm seeing:
2 'ImportError: No module named pyroute2'
3A: Install pyroute2:
4 git clone https://github.com/svinota/pyroute2.git
5 cd pyroute2; sudo make install
6
7Q: hello_world.py fails with:
Brenden Blancobd8fea42015-08-25 23:14:25 -07008 OSError: libbcc.so: cannot open shared object file: No such file or directory
Alexei Starovoitov0d056572015-06-09 20:36:56 -07009A: make sure to 'make install' and add the directory
Brenden Blancobd8fea42015-08-25 23:14:25 -070010 where libbcc.so was installed into your LD_LIBRARY_PATH
Tiezhu Yang9b6b05a2021-03-16 20:34:31 +080011 export LD_LIBRARY_PATH=$(dirname `find /usr -name libbcc.so`):$LD_LIBRARY_PATH
Alexei Starovoitov0d056572015-06-09 20:36:56 -070012
Yonghong Song66695702015-06-11 15:38:24 -070013Q: hello_world.py fails with:
Jan-Philip Gehrcke84d97982019-09-23 14:15:32 +020014 ImportError: No module named bcc
Yonghong Song66695702015-06-11 15:38:24 -070015A: checkout "sudo make install" output to find out bpf package installation site,
16 add it to the PYTHONPATH env variable before running the program.
Tiezhu Yang9b6b05a2021-03-16 20:34:31 +080017 export PYTHONPATH=$(dirname `find /usr/lib -name bcc`):$PYTHONPATH
Yonghong Song66695702015-06-11 15:38:24 -070018
Alexei Starovoitov0d056572015-06-09 20:36:56 -070019Q: hello_world.py still fails with:
20 bpf: Operation not permitted
21 Exception: Failed to load BPF program hello
22A: sudo
Marco Leogrande35de0502015-06-11 14:39:13 -070023
Jan-Philip Gehrckeac29d092019-09-26 18:41:34 +020024Q: hello_world.py fails with
25 bpf: Failed to load program: Operation not permitted
26 despite running as root, and strace shows each `bpf()` system call failing with an EPERM.
27A: The so-called Kernel lockdown might be the root cause. Try disabling it with the so-called
28 sysrq mechanism:
29 echo 1 > /proc/sys/kernel/sysrq
30 echo x > /proc/sysrq-trigger
31 Also see https://github.com/iovisor/bcc/issues/2525
Török Edwin18e09912020-01-09 13:15:22 +000032
33 If you have Secure Boot enabled you need to press Alt-PrintScr-x on the keyboard instead:
34 ```
35 This sysrq operation is disabled from userspace.
36 sysrq: Disabling Secure Boot restrictions
37 Lifting lockdown
38 ```
Jan-Philip Gehrckeac29d092019-09-26 18:41:34 +020039
Marco Leogrande35de0502015-06-11 14:39:13 -070040Q: How do I fulfill the Linux kernel version requirement?
41A: You need to obtain a recent version of the Linux source code
42 (please look at the README for the exact version), enable the
43 configuration options listed in the README file, install the image,
44 modules and headers, update your bootloader and reboot into the new
45 kernel.
46
47 If you want to compile your own kernel, you can fetch the sources
48 from kernel.org or through your Linux distribution.
49 To install, you need all of the following:
50 make install
51 make modules_install
52 make headers_install INSTALL_HDR_PATH=/usr/local/
Alexei Starovoitovcf358112015-06-17 12:55:42 -070053
54Q: hello_world.py fails with:
55 ImportError: No module named past.builtins
56A: sudo pip install future
Matty49ed9b22018-02-05 09:21:41 -050057
58Q: Running one of the bcc tools produces an import error:
59 Traceback (most recent call last):
60 File "./execsnoop", line 20, in <module>
61 from bcc import BPF
62 ImportError: No module named bcc
63A: Make sure the python bcc bindings package (python2-bcc) is installed.