discuss-gnuradio
[Top][All Lists]
Advanced

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

RE: Re: Import error using an OOT


From: Jim Melton
Subject: RE: Re: Import error using an OOT
Date: Tue, 13 Dec 2022 02:44:31 +0000

This thread seems to have gone for a while with a bit of thrashing. To recap:

 

> I have created an OOT which when I incorporate it in my flowgraph shows the following error:

> Failed to evaluate import _expression_ ‘import ft8’

 

This error is very clear. Python was not able to import your ft8 module.

 

Next,

> pi@raspberrypi:~ $ python3
> Python 3.9.2 (default, Mar 12 2021, 04:06:34)
> [GCC 10.2.1 20210110] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import ft8
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 23, in <module>
>    from .run_response import run_response
>  File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", line 36, in <module>
>    my_call = str(parser.get('main', 'my_call_sign'))
>  File "/usr/lib/python3.9/configparser.py", line 781, in get
>    d = self._unify_values(section, vars)
>  File "/usr/lib/python3.9/configparser.py", line 1149, in _unify_values
>    raise NoSectionError(section) from None
> configparser.NoSectionError: No section: 'main'

 

Also very clear; in your module __init__ you are trying to get a value from the ‘main’ section that does not exist.

 

But your config file has a ‘main’ section. So, then, the obvious implication is that your file is not being read.

 

As Johannes Demel pointed out,

 

> The `./` part in you file name is relative to the folder where you run Python. It is not relative to the `.py` file.

 

Even if you don’t specify “./”, it is assumed. So, either make sure that your config file is in the directory where you start the python process, or create some path to where your config file(s) live and include it in the argument to config.read().

 

---

Jim Melton



 

From: <discuss-gnuradio> On Behalf Of Elmore's
Sent: Monday, December 12, 2022 19:14
To: demel@ant.uni-bremen.de
Cc: discuss-gnuradio@gnu.org
Subject: [EXTERNAL] Re: Import error using an OOT

 

I tried omitting the ./ and still get the same error. I thought ./ indicated the current directory.

 

The .conf file is in the same directory as the .py file.

 

I tried using read_file and got a MissingSectionHeaderError.

 

Jim

 

 

 

Virus-free.www.avg.com

 

CONFIDENTIALITY NOTICE - SNC EMAIL: This email and any attachments are confidential, may contain proprietary, protected, or export controlled information, and are intended for the use of the intended recipients only. Any review, reliance, distribution, disclosure, or forwarding of this email and/or attachments outside of Sierra Nevada Corporation (SNC) without express written approval of the sender, except to the extent required to further properly approved SNC business purposes, is strictly prohibited. If you are not the intended recipient of this email, please notify the sender immediately, and delete all copies without reading, printing, or saving in any manner. --- Thank You.

reply via email to

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