[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] "ImportError: No module named myblock" when gener

From: yulong yang
Subject: Re: [Discuss-gnuradio] "ImportError: No module named myblock" when generating py file in GRC
Date: Thu, 21 Apr 2011 07:43:31 +0800

On Thu, Apr 21, 2011 at 7:17 AM, Josh Blum <address@hidden> wrote:

On 04/20/2011 03:00 AM, Yulong Yang wrote:
> Hello,
> I am new to GNU radio. I am trying to write a simple block and add it to
> GRC. All steps before are fine. However, when I generate the
> top_block.py file, it says "ImportError: No module named myblock".
> The myblock is actually the name of the folder I create to put all
> necessary files of my block such as files like MakeFile.am and
> sub-folders lib, swig, etc. Can this be called a module?

In the case of python, a module is a python file or a directory w/ a
python file __init__.py

Thank your for your reply.

So for example, the how-to--write-a-block folder stands for a module called "howto", right? Is the name of the module defined in the py file?

> What is a module? I see the code in how-to-write-a-block, it seems that
> it also import a module howto. Where could I find such modules or create
> one my own?
> Sorry to ask so many questions; I cannot find a clear way to study this.
> I would really appreciate any help.
> Thank you in advance.

Python needs to be able to find your block: Did you install it into the
python search path? Or set PYTHONPATH to where your block is installed?

Do your mean PYTHONPATH or just system search path? 
I have set my block path as the PYTHONPATH in ~/.profile, but it still cannot work. Is there a way to check whether the path is set appropriately?


Discuss-gnuradio mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]