Importing usrp2 module failing

Hi all,

I installed GNU Radio via the Ubuntu package first, and when trying to
run
usrp2_probe, i got the error “ImportError: cannot import name usrp2” …
so
then I tried a manual install from the latest git, and I still get that
same
error.

I have confirmed that gnuradio exists in:
/usr/local/lib/python2.6/dist-packages/gnuradio

I see the usrp2 module here:
-rw-r–r-- 1 root staff 58800 2010-04-21 14:34
/usr/local/lib/python2.6/dist-packages/gnuradio/usrp2.py

/usr/local/lib/python2.6/dist-packages is in the sys.path variable in
python:

sys.path
[’’, ‘/usr/lib/python2.6’, ‘/usr/lib/python2.6/plat-linux2’,
‘/usr/lib/python2.6/lib-tk’, ‘/usr/lib/python2.6/lib-old’,
‘/usr/lib/python2.6/lib-dynload’, ‘/usr/lib/python2.6/dist-packages’,
‘/usr/lib/python2.6/dist-packages/Numeric’,
‘/usr/lib/python2.6/dist-packages/PIL’,
‘/usr/lib/python2.6/dist-packages/gst-0.10’,
‘/usr/lib/pymodules/python2.6’,
‘/usr/lib/python2.6/dist-packages/gtk-2.0’,
‘/usr/lib/pymodules/python2.6/gtk-2.0’,
‘/usr/lib/python2.6/dist-packages/wx-2.6-gtk2-unicode’,
‘/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode’,
‘/usr/local/lib/python2.6/dist-packages’]

NOTE I do not get the import error when I do not run the command
with
sudo, but then I do not get the proper raw socket permissions. Maybe
that
rings a bell to someone? Something probably about an environment
variable I
am missing.

Thanks!
George

NOTE I do not get the import error when I do not run the command
with

sudo, but then I do not get the proper raw socket permissions. Maybe that
rings a bell to someone? Something probably about an environment variable I
am missing.

actually… I am getting the same error now without using sudo, so that
doesn’t seem to be a difference

  • George

its probably an issue of PYTHONPATH, make sure that the import works on
command line: python -c “from gnuradio import usrp2”

You should not need to run as root as long as the socket opener app has
suid permissions

sudo chown root:usrp which usrp2_socket_opener
sudo chmod 04750 which usrp2_socket_opener

-Josh

thanks Josh! I seem to have had a conflicting install in /usr/lib/
rather
than /usr/local/lib, so i blasted it and updated PYTHONPATH and all is
great
again :wink:

  • George

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs