0

On Ubuntu 16.04, when I run gnuradio-companion, I get this error:

ModuleNotFoundError

Cannot import gnuradio.

Is the python path environment variable set correctly?
    All OS: PYTHONPATH

Is the library path environment variable set correctly?
    Linux: LD_LIBRARY_PATH
    Windows: PATH
    MacOSX: DYLD_LIBRARY_PATH

(No module named 'gnuradio')

Here are some details about my environment:

dell@dell-XPS-15-9550:~$ python -V
Python 3.6.8

dell@dell-XPS-15-9550:~$ echo $PYTHONPATH

dell@dell-XPS-15-9550:~$ echo $LD_LIBRARY_PATH
::/usr/local/lib

dell@dell-XPS-15-9550:~$ 
dell@dell-XPS-15-9550:~$ which python
/usr/bin/python

dell@dell-XPS-15-9550:~$ python --version
Python 3.6.8

dell@dell-XPS-15-9550:~$ gnuradio-config-info -v
3.9.0.0-git

What can I do to solve this?

Per Lundberg
  • 3,837
  • 1
  • 36
  • 46
silience
  • 11
  • 1
  • 1

2 Answers2

1

Even I had the same problem after installation. I found that there are folders python3 and python3.6 in the installation directory, for example, in my case, it is

/home/chris/GRadio/lib/python3

and

/home/chris/GRadio/lib/python3.6

usually, we do include export

PYTHONPATH=$PYTHONPATH:/home/chris/GRadio/lib/python3.6/site-packages/

, but we will not do the same for python3

I included the below statement in .bashrc file

export PYTHONPATH=$PYTHONPATH:/home/chris/GRadio/lib/python3/dist-packages/

Then gnuradio-companion started opening.

S.S. Anne
  • 15,171
  • 8
  • 38
  • 76
-1

Unsure of this since I have never used gnuradio myself, but perhaps installing this package would help. Try the following command:

sudo apt-get install gnuradio

Then re-run gnuradio-companion again.

Per Lundberg
  • 3,837
  • 1
  • 36
  • 46
  • thank you so much. but i really did as you said. it does not work :( – silience Oct 27 '19 at 01:36
  • @silience then you somehow managed to either break your Python or GNU Radio installation, most probably through competing manual installations. Your Linux is positively ancient, and you'll only get very dated versions of GNU Radio to run on it. This is a good time to clean up your system and update your Ubuntu, and then follow Per's advice. – Marcus Müller Oct 27 '19 at 10:32
  • thank you. Should i change to use ubuntu18? I think the error ahbove is because of env path (i.e. $PYTHONPATH). But i am not sure and dont know how to set and what the PYTHONPATH should is. So boring – silience Oct 27 '19 at 16:46