作为初学者,我在Python GNU Radio Applications中尝试编码。当我在编辑器(Eclipse)中设置以下代码时
from gnuradio import gr
from gnuradio import audio, analog
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
sample_rate = 32000
ampl = 0.1
src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl)
src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
dst = audio.sink(sample_rate, "")
self.connect(src0, (dst, 0))
self.connect(src1, (dst, 1))
if __name__ == '__main__':
try:
my_top_block().run()
except [[KeyboardInterrupt]]:
pass
它显示以下错误:
**from gnuradio import gr
ImportError: No module named 'gnuradio':**
真的很感激任何帮助吗?
答案 0 :(得分:0)
安装gnuradio模块将解决@Padraic建议的问题。我搬回了我在Ubuntu的实验室,在那里安装了gnuradio员工。使用gnuradio模块在Ubuntu上安装Eclipse并且没有看到错误。