在从源代码构建BCC并运行测试"sudo /usr/share/bcc/tools/execsnoop“之后,我得到了以下输出:
回溯(最近一次调用):文件"/usr/share/ bcc /tools/execsnoop",第21行,来自bcc import BPF ImportError:没有名为bcc的模块
这意味着什么,可以做些什么来补救它?
安装依赖项后,以下是我遵循的步骤:
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发布于 2020-11-29 22:53:21
这是因为python2被设置为默认的python。
$ ls -l `which python`
lrwxrwxrwx 1 root root 7 Mar 4 2019 /usr/bin/python -> python2有一种方法可以更改所有出现的
#!/usr/bin/python到#!/usr/bin/python3
或
sudo ln -s /usr/bin/python3 /usr/bin/python或
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 100
update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python (python) in auto mode哪一项会将python更改为其他python
$ ls -l `which python`
lrwxrwxrwx 1 root root 24 Nov 29 20:21 /usr/bin/python -> /etc/alternatives/pythonhttps://stackoverflow.com/questions/65043495
复制相似问题