Hi, Ludovic Courtès skribis: > Hi Guillaume, > > guix-commits@gnu.org skribis: > >> (native-search-paths >> + ;; Variables required to find third-party plugins at runtime. >> (list (search-path-specification >> (variable "GRC_BLOCKS_PATH") >> - (files '("/share/gnuradio/grc/blocks"))))) >> + (files '("share/gnuradio/grc/blocks"))) >> + (search-path-specification >> + (variable "PYTHONPATH") >> + (files (list (string-append "lib/python" >> + (version-major+minor >> + (package-version python)) >> + "/site-packages")))))) >> (synopsis "Toolkit for software-defined radios") > > It’s not OK to have PYTHONPATH in here because that variable “belongs” > to Python, not to GNU Radio. > > A profile containing both gnuradio and python will have PYTHONPATH > correctly set. However, I guess you want to ensure that PYTHONPATH is > correct even when Python is not in the profile, right? > > In that case, I’d recommend wrapping the gnuradio executables such that > PYTHONPATH is correct. > > Does that make sense? > > See also one of our oldest bugs: . > > (Apologies if I missed a previous discussion!) > > Thanks, > Ludo’. The gnuradio-companion program generates a Python script based on the user's flowchart of signal processing blocks, and then executes it. Some extra "gnuradio blocks" can be added as plugin, like the gnuradio-osmosdr and gnuradio-iqbalance packages. For the Python script to be able to import the plugins installed in the Guix profile (or Guix environment), the PYTHONPATH variable must be defined in the profile (or environment). I got the idea of putting PYTHONPATH in native-search-paths from the Gajim package. I guess it will have to be fixed as well. What would be the best way to have PYTHONPATH set to the runtime profile or environment without putting it in native-search-paths? - Make python a native-input? - Wrap binaries with "PYTHONPATH=$GUIX_ENVIRONMENT/lib/python/3.7/site-packages:$GUIX_PROFILE/lib/python/3.7/site-packages:$PYTHONPATH"? - Something else?