Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnuradio version conda env #27

Closed
lahc1 opened this issue Sep 1, 2022 · 17 comments
Closed

gnuradio version conda env #27

lahc1 opened this issue Sep 1, 2022 · 17 comments

Comments

@lahc1
Copy link

lahc1 commented Sep 1, 2022

after installing conda env: conda env create -f environment.yml , and cmake .. -DCMAKE_INSTALL_PREFIX=/home/ubuntu16-sdr2/anaconda3/envs/gr310/ in gr310 env
gnuradio 3.8.2.0 is still running:

(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr/build$ gnuradio-companion -h
usage: gnuradio-companion [-h] [--log {debug,info,warning,error,critical}] [flow_graphs ...]

GNU Radio Companion 3.8.2.0 This program is part of GNU Radio GRC comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it.

positional arguments:
  flow_graphs

options:
  -h, --help            show this help message and exit
  --log {debug,info,warning,error,critical}
(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr/examples$ gnuradio-companion lora_TX.grc 
<<< Welcome to GNU Radio Companion 3.8.2.0 >>>

Block paths:
	/home/ubuntu16-sdr2/.grc_gnuradio
	/usr/local/share/gnuradio/grc/blocks

Loading: "/home/ubuntu16-sdr2/gr-lora_sdr/examples/lora_TX.grc"
Segmentation fault (core dumped)

any suggestions how to solve this issue ?

@tapparelj
Copy link
Owner

Hello @lahc1,
It seems the some paths to the older version of gnuradio are still remaining after the activation of the new conda environment. Can you answer to the following questions:

  • How did you installed gnuradio 3.8.2? with conda, pybombs, apt, from source, or any other way?
  • While in the environment gr310
    • Do the result conda list | grep "gnuradio" only mention versions 3.10.3.0?
    • What is the result of gnuradio-config-info -v --prefix?
    • What is the result of echo $PATH

@lahc1
Copy link
Author

lahc1 commented Sep 1, 2022

Hi @tapparelj,
yes it seems a conda path problem, but I am not able to solve it.
I installed gnuradio 3.8.2 using conda.
(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr_folder/gr-lora_sdr/examples$ conda list | grep "gnuradio"

gnuradio                  3.10.3.0        py310hb890b00_2    conda-forge
gnuradio-core             3.10.3.0        py310h179aa5a_2    conda-forge
gnuradio-grc              3.10.3.0        py310h0dc8b28_2    conda-forge
gnuradio-iio              3.10.3.0        py310h3058d4e_2    conda-forge
gnuradio-qtgui            3.10.3.0        py310hc030b51_2    conda-forge
gnuradio-soapy            3.10.3.0        py310h00a44fc_2    conda-forge
gnuradio-uhd              3.10.3.0        py310he2bccb3_2    conda-forge
gnuradio-video-sdl        3.10.3.0        py310h0dc8b28_2    conda-forge
gnuradio-zeromq           3.10.3.0        py310h935459f_2    conda-forge

(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr_folder/gr-lora_sdr/examples$ gnuradio-config-info -v --prefix

/home/ubuntu16-sdr2/anaconda3/envs/gr310/
3.10.3.0

(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr_folder/gr-lora_sdr/examples$ echo $PATH

/home/ubuntu16-sdr2/bin:/home/ubuntu16-sdr2/.local/bin:/home/ubuntu16-sdr2/anaconda3/envs/gr310/bin:/home/ubuntu16-sdr2/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr_folder/gr-lora_sdr/examples$ python3 tx_rx_functionnality_check.py

Traceback (most recent call last):
  File "/home/ubuntu16-sdr2/gr-lora_sdr_folder/gr-lora_sdr/examples/tx_rx_functionnality_check.py", line 23, in <module>
    import gnuradio.lora_sdr as lora_sdr
ModuleNotFoundError: No module named 'gnuradio.lora_sdr'

(gr310) ubuntu16-sdr2@ubuntu16sdr2-OptiPlex-7070:~/gr-lora_sdr_folder/gr-lora_sdr/examples$ gnuradio-companion &

[1] 16753
Gtk init_check failed. GRC might not be able to start a GUI.
Traceback (most recent call last):
  File "/home/ubuntu16-sdr2/anaconda3/envs/gr310/bin/gnuradio-companion", line 103, in <module>
    run_main()
  File "/home/ubuntu16-sdr2/anaconda3/envs/gr310/bin/gnuradio-companion", line 96, in run_main
    sys.exit(main())
  File "/usr/local/lib/python3/dist-packages/gnuradio/grc/main.py", line 73, in main
    from .gui.Platform import Platform
  File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/Platform.py", line 26, in <module>
    from . import canvas
  File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/__init__.py", line 21, in <module>
    from .param import Param
  File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/param.py", line 23, in <module>
    from .. import ParamWidgets, Utils, Constants
  File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 66, in <module>
    add_style_provider()
  File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 61, in add_style_provider
    Gtk.StyleContext.add_provider_for_screen(
TypeError: Argument 0 does not allow None as a value

[1]+  Exit 1                  gnuradio-companion

any suggestions?

@tapparelj
Copy link
Owner

Hi,
It seems that there is an issue with the overall installation if you can't launch gnuradio-companion. Can you try duplicating the conda environment again and when building the lora_sdr module, do not specify the prefix (it will install in the current conda environment if any is active)?

@lahc1
Copy link
Author

lahc1 commented Sep 6, 2022

Hi, It seems that there is an issue with the overall installation if you can't launch gnuradio-companion. Can you try duplicating the conda environment again and when building the lora_sdr module, do not specify the prefix (it will install in the current conda environment if any is active)?

Hi, I have done this but still stuck with same issues. I even deleted all the environment then install again and still stuck. any recommendation? thanks

gnuradio 3.8.2 is working fine in a separate conda environment.

@tapparelj
Copy link
Owner

Hi,
The argument 0 of Gtk.StyleContext.add_provider_for_screen( is uspposed to be your screen.

  • Do you have a peculiar setup for your display?
  • What is the output of echo $DISPLAY?
    • if there is not output can you try to run export DISPLAY=:0 ?

@lahc1
Copy link
Author

lahc1 commented Sep 6, 2022

hi,
that is not an issue, terminal is trying to launch Xming. I tried it also on the PC itself and got same output of Gnuradio.

@tapparelj
Copy link
Owner

Hi,
When you speak about the PC itself, just to be sure, its OS is Ubuntu?

@lahc1
Copy link
Author

lahc1 commented Sep 7, 2022

yes, it is Ubuntu 18.

could it be that the base or other conda environments are conflicting with gr310 env?
because on base and one other env GNURadio 3.8.2 is installed.

@tapparelj
Copy link
Owner

Can you try to set the path /home/ubuntu16-sdr2/anaconda3/envs/gr310/bin in the very beginning of $PATH to be sure it uses those binaries first?
export PATH=/home/ubuntu16-sdr2/anaconda3/envs/gr310/bin:$PATH

@lahc1
Copy link
Author

lahc1 commented Sep 7, 2022

image

after setting the path to: export PATH=/home/ubuntu16-sdr2/anaconda3/envs/gr310/bin:$PATH
GNURadio is running but with version 3.8.2.

(gr310) ubuntu16-sdr@ubuntu16sdr-OptiPlex-7070:~/Downloads/gr-lora_sdr/examples$ conda list | grep "gnuradio"
gnuradio                  3.10.3.0        py310hb890b00_2    conda-forge
gnuradio-core             3.10.3.0        py310h179aa5a_2    conda-forge
gnuradio-grc              3.10.3.0        py310h0dc8b28_2    conda-forge
gnuradio-iio              3.10.3.0        py310h3058d4e_2    conda-forge
gnuradio-qtgui            3.10.3.0        py310hc030b51_2    conda-forge
gnuradio-soapy            3.10.3.0        py310h00a44fc_2    conda-forge
gnuradio-uhd              3.10.3.0        py310he2bccb3_2    conda-forge
gnuradio-video-sdl        3.10.3.0        py310h0dc8b28_2    conda-forge
gnuradio-zeromq           3.10.3.0        py310h935459f_2    conda-forge
(gr310) ubuntu16-sdr@ubuntu16sdr-OptiPlex-7070:~/Downloads/gr-lora_sdr/examples$ gnuradio-config-info -v --prefix
/home/ubuntu16-sdr/miniconda3/envs/gr310/
3.10.3.0
(gr310) ubuntu16-sdr@ubuntu16sdr-OptiPlex-7070:~/Downloads/gr-lora_sdr/examples$ echo $PATH
/home/ubuntu16-sdr2/anaconda3/envs/gr310/bin:/home/ubuntu16-sdr/.local/bin:/home/ubuntu16-sdr/miniconda3/envs/gr310/bin:/home/ubuntu16-sdr/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

@tapparelj
Copy link
Owner

tapparelj commented Sep 7, 2022

Do you have anything in echo $PYTHONPATH and echo $LD_LIBRARY_PATH ?
If not you can try to set them
export PYTHONPATH=/home/ubuntu16-sdr2/anaconda3/envs/gr310/lib/python3.10/dist-packages:$PYTHONPATH
and
export LD_LIBRARY_PATH=/home/ubuntu16-sdr2/anaconda3/envs/gr310/lib:$LD_LIBRARY_PATH

@lahc1
Copy link
Author

lahc1 commented Sep 7, 2022

I already set echo $PYTHONPATH and echo $LD_LIBRARY_PATH as you mentioned. It is still not working.

(gr310) ubuntu16-sdr@ubuntu16sdr-OptiPlex-7070:~/Downloads/gr-lora_sdr/examples$ conda install gnuradio=3.10 python=3.10.5
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

Retrieving notices: ...working... done

@tapparelj
Copy link
Owner

In a terminal what is the output from python, import gnuradio, gnuradio ?

@lahc1
Copy link
Author

lahc1 commented Sep 7, 2022

It worked after following this page: https://wiki.gnuradio.org/index.php?title=ModuleNotFoundError#B._Finding_the_Python_library

(gr310) ubuntu16-sdr@ubuntu16sdr-OptiPlex-7070:~/Downloads/gr-lora_sdr/examples$ gnuradio-companion -h
usage: gnuradio-companion [-h] [--log {debug,info,warning,error,critical}] [flow_graphs ...]

GNU Radio Companion 3.10.3.0 This program is part of GNU Radio GRC comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it.

positional arguments:
  flow_graphs

options:
  -h, --help            show this help message and exit
  --log {debug,info,warning,error,critical}

I have another problem with UHD, it got updated to version 4.2.0. But the version I need is 3.15 because the USRPs are also flashed with UHD3.15:

(gr310) ubuntu16-sdr@ubuntu16sdr-OptiPlex-7070:~/Downloads/gr-lora_sdr/examples$ ./lora_TX.py 
[INFO] [UHD] linux; GNU C++ version 10.3.0; Boost_107400; UHD_4.2.0.HEAD-release
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.10.2,type=n3xx,product=n320,serial=31EABBA,claimed=False,addr=192.168.10.2

any suggestion how to switch back to UHD3.15?
thanks.

@tapparelj
Copy link
Owner

Can't you just conda remove uhd and conda install -c conda-forge uhd=3.15 ?

@lahc1
Copy link
Author

lahc1 commented Sep 7, 2022

it worked, now I have UHD 3.15.0. But uhd_usrp_sink is missing from GNURadio. I tried sudo ldconfig, it didn't help.
is there any way to make UHD 3.15 compatible with GNURadio 3.10.3 ?

image

@tapparelj
Copy link
Owner

Hi,
is gnuradio-uhd still listed by conda list | grep "gnuradio" ? If not you can try to install it with conda install gnuradio-uhd and see if it tries to override your UHD installation. Else you might try to build gr-uhd from source (https://github.com/gnuradio/gnuradio/tree/main/gr-uhd).
In any case, I'm not aware of which version of UHD is compatible or not with gnuradio 3.10 but reflashing your USRP might be the easiest way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants