Cannot import gnuradio. Is python set correctly?
In what must be my 6th distinct attempt in as many months to setup and run GNU Radio on Windows, I have finally succeeded! I admit I'm a little delirious with joy and disbelief. I'm answering here because I was getting the exact same error you are, and I suspect you're having the same problem despite the different platform.
What worked for me (after installing GNU Radio binaries from Ettus, including adding it to the path, and installing Python 2.7):
- Set
PYTHONPATH
=[your Python install]\Lib\site-packages;
[GNU Radio install]\lib\site-packages
pip install pygtk
pip install numpy
pip install lxml
pip install Cheetah
(Note: on Windows, pip installs must be run from elevated command prompt "Run as administrator")
I figured out the problem by launching Python interactively and trying the failing statement from gnuradio-companion.py manually, from gnuradio import gr
which gave me ImportError: No module named numpy
. That's when it clicked that the module loading was failing while loading its dependent modules, and pip to the rescue to solve that!