jboone / gr-tpms

Tire Pressure Monitor tools for GNU Radio
GNU General Public License v2.0
170 stars 36 forks source link

ImportError: cannot import name rotator_cc #8

Closed greg5678 closed 7 years ago

greg5678 commented 8 years ago

How do I fix this from gnuradio.blocks import rotator_cc ImportError: cannot import name rotator_cc

jboone commented 8 years ago

More details would be useful. What operating system and version are you using? Which major, minor, and release version of GNU Radio are you using? Are you installing GNU Radio via a package manager (e.g. Debian apt, MacPorts, Brew, etc.)? During what phase of installation or execution are you encountering this error? Can you post a log of commands and output leading up to the error?

greg5678 commented 8 years ago

I'm running on a Pi running Raspbian. pi@raspberrypi ~/gnuradio $ gnuradio-config-info --version 3.7.5git-0-g2bb2b314

jboone commented 8 years ago

I think you will have a larger problem. This GNU Radio tool is far too compute-intensive to run on something like a Raspberry Pi.

Regardless, I could still use more of the information I requested earlier. What phase of installation or execution are you encountering the error? Is it something seen when running one of the gr-tpms tools, or during the build process, or...?

greg5678 commented 8 years ago

Every thing compiled just fine. Only when I ran pi@raspberrypi ~/gnuradio $ sudo tpms_rx --source rtlsdr --if-rate 400000 --tuned-frequency 315000000 Traceback (most recent call last): File "/usr/local/bin/tpms_rx", line 30, in from gnuradio import analog File "/usr/local/lib/python2.7/dist-packages/gnuradio/analog/init.py", line 35, in from am_demod import File "/usr/local/lib/python2.7/dist-packages/gnuradio/analog/am_demod.py", line 24, in from gnuradio import filter File "/usr/local/lib/python2.7/dist-packages/gnuradio/filter/init.py", line 34, in from freq_xlating_fft_filter import File "/usr/local/lib/python2.7/dist-packages/gnuradio/filter/freq_xlating_fft_filter.py", line 26, in from gnuradio.blocks import rotator_cc ImportError: cannot import name rotator_cc did any problems happen

jboone commented 8 years ago

Now we're getting somewhere. That looks like some sort of GNU Radio build problem, as it's happening inside the GNU Radio libraries. rotator_cc is a signal processing block. I think it's fairly new. It's possible you do not have all the necessary packages installed to provide that block. I don't know what the packages are called in Raspbian, but you almost certainly need the GNU Radio "blocks" and VOLK packages.

jboone commented 8 years ago

Found here: http://raspberrypi.stackexchange.com/questions/9558/how-to-install-gnuradio-on-raspberry-pi

"If you want do develop using gnuradio, make sure to also install gnuradio-dev and maybe also the different libgnuradio* packages (you can search for them using apt-cache seardch libgnuradio)."

Give that a try.

greg5678 commented 8 years ago

pi@raspberrypi ~/gnuradio $ ls 0001-volk-Fix-volk_malloc-when-alignment-is-1.patch gr-fec build gr-fft cmake gr-filter CMakeLists.txt gr-noaa config.h.in gr-pager COPYING gr-qtgui docs gr-trellis dtools gr-uhd gnuradio-runtime gr-utils gr-analog gr-video-sdl gr-atsc gr-vocoder gr-audio gr-wavelet gr-blocks gr-wxgui grc gr-zeromq gr-channels README gr-comedi README.building-boost gr-digital README.hacking gr-fcd

greg5678 commented 8 years ago

sudo apt-get install gnuradio Reading package lists... Done Building dependency tree
Reading state information... Done Package gnuradio is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'gnuradio' has no installation candidate

jboone commented 7 years ago

Not sure where this was left, but it sounds like either a GNU Radio installation problem, or GNU Radio being an older version, or not having support for all the standard blocks when built on ARM. Closing.