discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with gnuradio paths and syntax errors


From: Sarah Rogers
Subject: Re: Issues with gnuradio paths and syntax errors
Date: Sat, 25 Jan 2020 16:07:36 -0700

Thank you for the direction, Mike! I figured out my syntax issue, but in trying to resolve that, new errors arose. It turns out that my system was set up to run python 2.7.15, when gnuradio runs python3. I adjusted my system so that it ran off of python 3.6.8, based on the instructions posted in this link: https://github.com/daniestevez/gr-satellites/wiki/Installation-of-GNUradio-3.8-under-Ubuntu-18.04-LTS,-(K)Ubuntu-19.04,-Mint-19.2-Mate,-Mint-19.2-Cinnamon-or-Ubuntu-19.10

This changed my system to run python3.6.8 correctly, but I think I have installed gnuradio incorrectly, as I am still getting errors. I also successfully uninstalled the pybombs version of gnuradio using the command `pybombs remove gnuradio uhd` to eliminate other issues, leaving only the ppa version installed. However, this didn't change anything either. 

Now, if I run the command `python3 filename.py` I get the following output:

Traceback (most recent call last):
  File "taurus1_telemetry_parser.py", line 26, in <module>
    from . import by701_telemetry
ImportError: cannot import name 'by701_telemetry'


The interesting thing was that gnuradio was pointed at the python3 location. If I ran head /usr/local/bin/gnuradio-companion I received the following:

image.png

Since there were so many issues with the gnuradio config, I tried to see if I could easily uninstall the ppa version and just start fresh with gnuradio. I went into my directory for gnuradio (Desktop/gnuradio/build) and tried a `make uninstall`. Doing a `make uninstall` process did not produce any errors, but this did not seem to remove gnuradio from my system entirely.

gnuradio can still be found in `/usr/local/lib/python3/dist-packages`, and I still get the ImportError when I try to run a python script. However, now when I enter `head /usr/local/bin/gnuradio-companion`, I get the following message:
head: cannot open '/usr/local/bin/gnuradio-companion' for reading: No such file or directory

The output of `which gnuradio-companion` is:   /usr/bin/gnuradio-companion

I'm kind of lost on what to do here now. Any ideas on how gnuradio can either be fixed or uninstalled entirely?

On Sat, Jan 25, 2020 at 5:27 AM Michael Dickens <address@hidden> wrote:
Hi Sarah - From the Python error, it looks like you're mixing Python 3 code with a Python 2 executable. Since you don't list your actual commands issued, I can't tell. If you have both installed and don't know if you need Py2, I'd say to try removing it & see what happens for a day. Hope this helps! - MLD

On Sat, Jan 25, 2020 at 2:25 AM Sarah Rogers <address@hidden> wrote:
Hello,

I'm having some issues using gnuradio with python programs. I am trying to use gnuradio with gr-satellites' python programs to decode packets from CubeSats. When I try to run a python file, I receive the following output

Traceback (most recent call last):
  File "taurus1_telemetry_parser.py", line 23, in <module>
    from gnuradio import gr
  File "/usr/local/lib/python3/dist-packages/gnuradio/gr/__init__.py", line 39, in <module>
    from .runtime_swig import *
  File "/usr/local/lib/python3/dist-packages/gnuradio/gr/runtime_swig.py", line 117
    def value(self) -> "PyObject *":
                    ^
SyntaxError: invalid syntax


I have read that syntax errors result from different python versions, but I am also wondering if this might be the result of something else. I first tried investigating the syntax error, but when I didn't find anything, I became sucked into the black hole that is my potential issue below.

I received the syntax error after editing my bash.rc file to include the path to the python3 library where the gnuradio folder is contained. In the process of investigating the path issue, it appeared that I didn't have all of the path dependencies that people normally do for running gnuradio with python. I'm not sure if this issue and my syntax error are related, so I thought I would inquire on here.  

The following command is in my bashrc file:

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3/dist-packages

as reference, you can see that `/python3/dist-packages` contains gnuradio, along with a few other folders

WorkStation-T5500:/usr/local/lib/python3/dist-packages$ ls
gnuradio  pmt  satellites  volk_modtool


In addition, the gnuradio folder contains the following:
image.png

However, based on the following references for installing gnuradio, it seems that I am missing the paths to gnuradio/lib and gnuradio/bin. I have not been able to find information that will allow me to fix this. Based on posts that I have read with similar questions as mine, I thought this may be one issue with my setup, but I could also be misinterpreting something.  

[Ref 1 (Ghithub) ](https://github.com/gnuberries/raspberry-radio/wiki/GNU-Radio-Installation-Instructions-(for-desktop-or-notebook))

[Ref 2 (lists.gnu.org)](https://lists.gnu.org/archive/html/discuss-gnuradio/2016-08/msg00017.html)

I installed gnuradio through ppa, as well as pybombs. Do you think the missing paths could be the source of my issue, or are there actually multiple issues here? If so, would it be better to just delete gnuradio entirely and try to install it fresh using pybombs?

Thank you for any advice you may have here. I'm still getting used to linux and solving installation issues in general, so please let me know if I can clarify anything further. 

~Sarah


--
Michael Dickens
Ettus Research Technical Support
Email: address@hidden
Web: https://ettus.com/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]