简体   繁体   English

ImportError:没有名为“ gnuradio”的模块

[英]ImportError: No module named 'gnuradio'

As a beginner I'm trying Coding in Python GNU Radio Applications. 作为一个初学者,我正在尝试在Python GNU Radio Applications中进行编码。 When I set the following code in the editor (Eclipse) 当我在编辑器(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

It show the following error: 它显示以下错误:

   **from gnuradio import gr

ImportError: No module named 'gnuradio':**

Any help will be really appreciated ? 任何帮助将不胜感激?

Installing gnuradio module will solve the problem as suggested by @Padraic. 安装gnuradio模块将解决@Padraic建议的问题。 I moved back to my lab in Ubuntu where I have gnuradio staff installed. 我回到了我在Ubuntu上安装了gnuradio人员的实验室。 Installed Eclipse on Ubuntu using gnuradio module and no error seen. 使用gnuradio模块在Ubuntu上安装了Eclipse,没有看到错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM