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
No comments:
Post a Comment