本文记录在 GNURadio 自定义Python OOT 块后导入块时报错 ModuleNotFoundError: No module named xxx。
参考官方教程 Creating Python OOT with gr-modtool 创建自定义的 OOT块(OOT 模块是不存在于 GNU Radio 源代码树中的 GNU Radio 组件。全拼:Out-Of-Tree),运行时出现了如下报错:
Traceback (most recent call last): File “/home/gnep/GNURadio_test/ofdm/test.py”, line 36, in import customModule ModuleNotFoundError: No module named ‘customModule’

cd /home/gnep/gr-customModule/build
sudo make uninstall
将官方教程 cmake .. 中的第3个命令替换为 cmake -DCMAKE_INSTALL_PREFIX=$(gnuradio-config-info --prefix) ..
cd /home/gnep/gr-customModule/build
cmake -DCMAKE_INSTALL_PREFIX=$(gnuradio-config-info --prefix) ..
make
sudo make install
sudo ldconfig 
打开 gnuradio
gnuradio-companion &再次运行,已无报错
