0
$\begingroup$

I know guys you gonna tell me tat there is something wrong about GnuRadio or Pybombs installation. Well, this is my third time during the past 48 hours I reformat the OS of my mini pc fitlet2 mint linux and reinstall the the OS which is mint 19.1 cinamon and reinstall gnuradio using apt-get or even using Pybombs and get this problem when I try Python3 to run my .py file. Please, I am in real need for your help, again, I am a real beginner and try to learn. Here is how I installed Pybombs:

sudo apt-get install python3-pip
sudo apt-get install python3-setuptools
sudo pip3 install wheel
sudo apt-get install python3-setuptools
sudo pip3 install pybombs
pybombs auto-config
pybombs recipes add-defaults
pybombs prefix init ~/gnuradio -R gnuradio-default
pybombs install gr-osmosdr
pip install analog
sudo uhd_images_downloader
. ~/gnuradio/setup_env.sh
gnuradio companion

Later, I learned Kevin here on this community how to generate a python code from Gnuradion to run it through a python web server that I built based on simple script that I've found online. When I run it using python3 I get the "ModuleNotFoundError: No module named 'gnuradio'" error.

enter image description here

enter image description here

I know you may say something again about editing the PYTHONPATH file, and that is the other problem to be honest. I mean I am not sure what I am suppose to change aboutthe steup_env.sh file? Shouldn't be set and ready to go! If not, then please, guide me on how to do it.

This is my setup_env.sh file:

enter image description here

Update:

I just noticed that when I run 'Pybombs run gnuradio companion' the interface itself, it generated this error:

<<< Welcome to GNU Radio Companion 3.7.13.5 >>>

Block paths:
    /home/fit-pc/gnuradio/share/gnuradio/grc/blocks
    /home/fit-pc/gnuradio/share/gnuradio/grc/blocks

Loading: "/media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/FM-Radio-Receiver.grc"
>>> Done

Generating: '/media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/top_block.py'

Executing: /usr/bin/python2 -u /media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/top_block.py

gr-osmosdr v0.1.4-127-g4d83c606 (0.1.5git) gnuradio 3.7.13.5
built-in source types: file osmosdr fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy soapy redpitaya 
[0;32m[INFO] [UHD] [0;39mlinux; GNU C++ version 7.4.0; Boost_106501; UHD_3.15.0.git-16-gcad30dfe
Traceback (most recent call last):
  File "/media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/top_block.py", line 189, in <module>
    main()
  File "/media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/top_block.py", line 183, in main
    tb = top_block_cls()
  File "/media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/top_block.py", line 101, in __init__
    self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' )
  File "/home/fit-pc/gnuradio/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py", line 1170, in make
    return _osmosdr_swig.source_make(*args, **kwargs)
RuntimeError: No supported devices found (check the connection and/or udev rules).

The other thing that I just noticed is when I run the Pybombs GR in the terminal it shows warnings "blocks already exist", but then the programs starts normally:

fit-pc@fitpc-fitlet2:~$ pybombs run gnuradio-companion
PyBOMBS.ConfigManager - INFO - Prefix Python version is: 3.6.8
PyBOMBS - INFO - PyBOMBS Version 2.3.3
Warning: Block with key "analog_agc2_xx" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/analog_agc2_xx.xml
Warning: Block with key "analog_agc3_xx" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/analog_agc3_xx.xml
Warning: Block with key "analog_agc_xx" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/analog_agc_xx.xml
Warning: Block with key "analog_am_demod_cf" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/analog_am_demod_cf.xml
Warning: Block with key "analog_const_source_x" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/analog_const_source_x.xml
..

..

..

..
Warning: Block with key "zeromq_sub_msg_source" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/zeromq_sub_msg_source.xml
Warning: Block with key "zeromq_sub_source" already exists.
    Ignoring: /home/fit-pc/gnuradio/share/gnuradio/grc/blocks/zeromq_sub_source.xml
<<< Welcome to GNU Radio Companion 3.7.13.5 >>>

Block paths:
    /home/fit-pc/gnuradio/share/gnuradio/grc/blocks
    /home/fit-pc/gnuradio/share/gnuradio/grc/blocks

Loading: "/media/fit-pc/DA54CCFE54CCDDFF/Mint Linux stuff/mint backup/My-Projects/FM-Radio-Receiver/FM-Radio-Receiver.grc"
>>> Done

Update:

The "NO supported devices ..." error is fixed now after I run "/home/fit-pc/gnuradio/lib/uhd/utils/uhd_images_downloader.py", so the gnuradio gui/interface works and generates output normally with the usrp. But

But I still have the original error there which is "No module named 'analog_swig'" whenever I run python3 /home/fit-pc/Desktop/python-web-server/serv.py in the terminal.

Here i my original .grc file (the ID here is top_block and not Exercise_1 for demonstration purposes):

enter image description here

And to generate my python code to run it through the web server I had to remove the FFT sink, Multiply Const, and the Slider and run it as "No Gui" as I was instructed before:

enter image description here

My last Update:

If I run it using python2.7 in the Terminal I get this and nothing happens:

enter image description here

$\endgroup$
13
  • 1
    $\begingroup$ GNU Radio 3.7 is not python3 compatible. As you can in fact easily see from your module paths, which contain python2.7. $\endgroup$ Jul 15 '19 at 7:56
  • $\begingroup$ @MarcusMüller This is a little disappointing - are you aware if Python 3 migration is a work in progress? $\endgroup$
    – flow2k
    Jul 15 '19 at 8:30
  • 1
    $\begingroup$ more than aware. As soon as I release GNU Radio 3.8, Python3 will be the preferred Python version, and with 3.9, we'll drop Python2 support, @flow2k. $\endgroup$ Jul 15 '19 at 9:30
  • $\begingroup$ @MarcusMüller, Actually, to me, this is a real good news! At least I know that whatever I did was not wrong. Beside, I learned some good stuff while digging around this issue during the past a few days. Most important, I can move to my next phase in my GnuRadio training. I will take this as an answer to my posting. Thanks Marcus. $\endgroup$
    – Hadad
    Jul 15 '19 at 11:58
  • $\begingroup$ You should really not be using pybombs at this point; mint should ship gnuradio and gnuradio-dev, and that's all you'd need for working GNU Radio. $\endgroup$ Jul 15 '19 at 12:11