Gr-howto import error

Background info:
GNU Radio trunk, revision 11163
Ubuntu 8.04, 32bit
make version 3.81
autoconf version 2.61
gcc version 4.2.4

The problem I am having:
I downloaded gr-howto-write-a-block-3.2.tar.gz from
Index of /gnu/gnuradio, extracted it, and ran ./configure, make, make
check and make install. (I did all this using sudo; my source tree is
owned by root.) There were no apparent errors, but I can include the
output if it is desired. I attempted to run qa_howto.py and recieved the
following error:

Traceback (most recent call last):
File “./qa_howto.py”, line 24, in
import howto
ImportError: No module named howto

Per a comment from Eric on 18 Nov, 05 to the list, I checked my
PYTHONPATH variable:

$ echo $PYTHONPATH
/usr/local/lib/python2.5/site-packages

I also found a thread started by William Sherman from April 09 with
similar issues, but I did not see its resolution.

So, the question:
Can anyone tell me if I’ve missed something about how to install “howto”
and import it successfully? I have had no operational problems with my
trunk install of gnuradio.

Thanks,
Alex Y.

On Thu, Aug 13, 2009 at 04:32:37PM -0400, Alex young wrote:

check and make install. (I did all this using sudo; my source tree is
owned by root.) There were no apparent errors, but I can include the
output if it is desired. I attempted to run qa_howto.py and recieved the
following error:

Traceback (most recent call last):
File “./qa_howto.py”, line 24, in
import howto
ImportError: No module named howto

Try running:

make check

Alex,

The “make check” command invokes run_tests which run everything that
matches
qa_*.py (qa_howto.py)and return the final result. It will bypass the
default
PYTHONPATH and set your own built tree in which search for your
C++/python
files. You can find these settings in run_tests:

Where to look in the build tree for our shared library

libbld=/home/yuan/Desktop/SDR/built/src/lib

Where to look in the src tree for swig generated python code

libsrc=/home/yuan/Desktop/SDR/built/src/lib

Where to look in the src tree for hand written python code

py=/home/yuan/Desktop/SDR/built/src/python

Where to look for installed GNU Radio python modules

FIXME this is wrong on a distcheck. We really need to ask

gnuradio-core

where it put its python files.

installed_pythondir=/usr/lib/python2.6/dist-packages
installed_pyexecdir=/usr/lib/python2.6/dist-packages

PYTHONPATH=“$libbld:$libbld/.libs:$libsrc:$py:$installed_pythondir:$installed_pyexecdir:$PYTHONPATH”
#PYTHONPATH=“$libbld:$libbld/.libs:$libsrc:$py:$installed_pythondir:$installed_pyexecdir”

Also, I think there’s another way which could run qa_howto.py directly.
As
howto.py has already been generated by SWIG, you can find it under
python
sys.path directory:
/usr/lib/python2.6/dist-packages/gnuradio

While the command “import howto.py” in qa_howto.py will try to import
that
file from /usr/lib/python2.6/dist-packages (howto.py’s parent
directory),
but it is not there. You can modify this command as “from gnuradio
import
howto” to import howto successfully.

Hope it will help.

Milo

Alex Y. wrote:

Index of /gnu/gnuradio, extracted it, and ran ./configure, make, make

Can anyone tell me if I’ve missed something about how to install “howto”
Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://www.nabble.com/gr-howto-import-error-tp24962082p24976686.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Fri, 2009-08-14 at 10:59 -0700, Eric B. wrote:

Try running:

make check

I tried running make check again and did not see any errors. Here is the
output:

$ sudo make check
Making check in config
make[1]: Entering directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/config' make[1]: Nothing to be done forcheck’.
make[1]: Leaving directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/config' Making check in src make[1]: Entering directory/work/gnuradio_src/gr-howto-write-a-block-3.2/src’
Making check in lib
make[2]: Entering directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/src/lib' make check-am make[3]: Entering directory/work/gnuradio_src/gr-howto-write-a-block-3.2/src/lib’
make[3]: Nothing to be done for check-am'. make[3]: Leaving directory/work/gnuradio_src/gr-howto-write-a-block-3.2/src/lib’
make[2]: Leaving directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/src/lib' Making check in python make[2]: Entering directory/work/gnuradio_src/gr-howto-write-a-block-3.2/src/python’
make check-TESTS
make[3]: Entering directory
`/work/gnuradio_src/gr-howto-write-a-block-3.2/src/python’

Ran 2 tests in 0.530s

OK
PASS: run_tests

1 test passed

make[3]: Leaving directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/src/python' make[2]: Leaving directory/work/gnuradio_src/gr-howto-write-a-block-3.2/src/python’
make[2]: Entering directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/src' make[2]: Nothing to be done forcheck-am’.
make[2]: Leaving directory
/work/gnuradio_src/gr-howto-write-a-block-3.2/src' make[1]: Leaving directory/work/gnuradio_src/gr-howto-write-a-block-3.2/src’
make[1]: Entering directory
/work/gnuradio_src/gr-howto-write-a-block-3.2' make[1]: Leaving directory/work/gnuradio_src/gr-howto-write-a-block-3.2’

I subsequently tried to run qa_howto.py and received the same response:

$ sudo ./qa_howto.py
Traceback (most recent call last):
File “./qa_howto.py”, line 24, in
import howto
ImportError: No module named howto

Trying to import howto directly using ipython gives similar results:

import howto

<type ‘exceptions.ImportError’> Traceback (most recent call
last)

/usr/local/ in ()

<type ‘exceptions.ImportError’>: No module named howto

I have a feeling that I don’t understand some fundamental part of the
install and/or run process, but I am not sure what that is.

Thanks,
alex

qa_*.py (qa_howto.py)and return the final result. It will bypass the default
PYTHONPATH and set your own built tree in which search for your C++/python
files. You can find these settings in run_tests:
[…]

Milo,

Thanks for all this info. It will probably take me a day or two to sort
it out, I will let you know how it turns out…

-alex

qa_*.py (qa_howto.py)and return the final result. It will bypass the default
PYTHONPATH and set your own built tree in which search for your C++/python
files. You can find these settings in run_tests:
[…]

Milo,

Thanks for all this info. It will probably take me a day or two to sort
it out, I will let you know how it turns out…

Milo,

Thanks again. The information you provided was what we needed here to
make it work.

Thanks,
-alex