Re: Import error using an OOT

2022-12-12 Thread Elmore Family
You are confusing main() in run_response.py with the ‘main’ section in 
ft8_qso.conf.

parser.get in line 36 is looking for the ‘main’ section but throws the 
NoSectionError.

Why can’t the parser see the ‘main’ section?

When I said I have run an OOT before, I meant another OOT which runs well in 
this same app. However, this is irrelevant since we are not talking about the 
same problem.

Jim

From: Cinaed Simson
Sent: Monday, December 12, 2022 12:57 AM
To: Elmore Family
Cc: discuss-gnuradio@gnu.org
Subject: Re: Import error using an OOT

The main method is defined beginning on line 216 and called 4 times on lines 
36-39.

And it appears the configparser is throwing the NoSectionError.

Try commenting out line 36 to see if line 37 throws the same exception.

When you said is has run before, did it run under python3.9?

-- Cinaed



On 12/11/22 19:11, Elmore Family wrote:

  I have attached the 2 files in question. Look at the beginning of 
run_response.py. It uses ConfigParser to access the ft8_qso.conf configuration 
file.

  This line seems to be the problem: my_call = str(parser.get('main', 
'my_call_sign')).

  But ‘main’ is a section in the ft8_qso.conf file. Why can’t it find ‘main’?

  Jim


  From: Cinaed Simson
  Sent: Sunday, December 11, 2022 8:52 PM
  To: Elmore Family
  Cc: discuss-gnuradio@gnu.org
  Subject: Re: Import error using an OOT

  The problem appears to be in the python code

response.py

  - there is no 'main()' method.

  -- Cinaed


  On 12/11/22 09:48, Elmore Family wrote:

Here is the result:

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 "", line 1, in 
  File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 23, 
in 
from .run_response import run_response
  File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", line 
36, in 
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'


Jim



From: Cinaed Simson
Sent: Sunday, December 11, 2022 12:15 AM
To: discuss-gnuradio@gnu.org
Subject: Re: Import error using an OOT

Type

   python3

then enter

  import ft8

and see if it works.

-- Cinaed



On 12/9/22 18:33, Elmore's wrote:

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

  Failed to evaluate import expression ‘import ft8’

  The yaml file is:

  id: ft8_run_response
  label: ft8
  category: '[ft8]'

  templates:
imports: import ft8
make: ft8.run_response(${ft8_button})
callbacks:
- set_ft8(${ft8_button})

  #  Make one 'parameters' list entry for every parameter you want settable 
from the GUI.
  # Keys include:
  # * id (makes the value accessible as keyname, e.g. in the make entry)
  # * label (label shown in the GUI)
  # * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
  # * default
  parameters:
  - id: ft8_button
label: ft8_button
dtype: raw
default: 0

  #  'file_format' specifies the version of the GRC yml format used in the 
file
  #  and should usually not be changed.
  file_format: 1

  I have developed and used an OOT before without an issue. I looked at the 
previous OOT and reviewed the GNU Radio docs on OOTs without seeing anything 
different.

  I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi.

  I hope someone can show me the error of my ways.

  Jim

   Virus-free.www.avg.com








--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Re: Import error using an OOT

2022-12-12 Thread Johannes Demel

Hi all,

it looks like there's a path issue.

In line 34 in "run_response.py" you do
```
parser.read('./ft8_qso.conf')
```
There's a good chance, that you did not load this file.
I assume this is:
https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read

> If none of the named files exist, the ConfigParser instance will
> contain an empty dataset. An application which requires initial values
> to be loaded from a file should load the required file or files using
> read_file() before calling read() for any optional files:

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


Anyways, You might want to check which file gets read when etc.

Cheers
Johannes

On 12.12.22 15:27, Elmore Family wrote:
You are confusing main() in run_response.py with the ‘main’ section in 
ft8_qso.conf.
parser.get in line 36 is looking for the ‘main’ section but throws the 
NoSectionError.

Why can’t the parser see the ‘main’ section?
When I said I have run an OOT before, I meant another OOT which runs 
well in this same app. However, this is irrelevant since we are not 
talking about the same problem.

Jim
*From:* Cinaed Simson
*Sent:* Monday, December 12, 2022 12:57 AM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The main method is defined beginning on line 216 and called 4 times on 
lines 36-39.


And it appears the configparser is throwing the NoSectionError.

Try commenting out line 36 to see if line 37 throws the same exception.

When you said is has run before, did it run under python3.9?

-- Cinaed


On 12/11/22 19:11, Elmore Family wrote:
I have attached the 2 files in question. Look at the beginning of 
run_response.py. It uses ConfigParser to access the ft8_qso.conf 
configuration file.
This line seems to be the problem: my_call = str(parser.get('main', 
'my_call_sign')).
But ‘main’ is a section in the ft8_qso.conf file. Why can’t it find 
‘main’?

Jim
*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 8:52 PM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The problem appears to be in the python code

  response.py

- there is no 'main()' method.

-- Cinaed

On 12/11/22 09:48, Elmore Family wrote:

Here is the result:

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 "", line 1, in 
File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 
23, in 

from .run_response import run_response
File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", 
line 36, in 

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'

Jim

*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 12:15 AM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
Type

   python3

then enter

  import ft8

and see if it works.

-- Cinaed


On 12/9/22 18:33, Elmore's wrote:
I have created an OOT which when I incorporate it in my flowgraph 
shows the following error:

Failed to evaluate import expression ‘import ft8’
The yaml file is:
id: ft8_run_response
label: ft8
category: '[ft8]'
templates:
  imports: import ft8
  make: ft8.run_response(${ft8_button})
  callbacks:
  - set_ft8(${ft8_button})
#  Make one 'parameters' list entry for every parameter you want 
settable from the GUI.

# Keys include:
# * id (makes the value accessible as keyname, e.g. in the make 
entry)

# * label (label shown in the GUI)
# * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
# * default
parameters:
- id: ft8_button
  label: ft8_button
  dtype: raw
  default: 0
#  'file_format' specifies the version of the GRC yml format used in 
the file

#  and should usually not be changed.
file_format: 1
I have developed and used an OOT before without an issue. I looked 
at the previous OOT and reviewed the GNU Radio docs on OOTs without 
seeing anything different.

I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi.
I hope someone can show me the error of my ways.
Jim


  Virus-free.www.avg.com 










smime.p7s
Description: S/MIME Cryptographic Signature


Re: Import error using an OOT

2022-12-12 Thread Cinaed Simson

No I'm not.

The ft8_qso.conf.is a data input file - or a yaml file - it is read by 
the python code.


If there's a problem with the python code, the application will crash 
and burn regardless of the content of ft8_qso.conf.


If you change the the top line in the file

  run_response.py code

from

  #!/usr/bin/env python

to

  #!/usr/bin/env python3

it should work.

-- Cinaed



On 12/12/22 06:27, Elmore Family wrote:
You are confusing main() in run_response.py with the ‘main’ section in 
ft8_qso.conf.
parser.get in line 36 is looking for the ‘main’ section but throws the 
NoSectionError.

Why can’t the parser see the ‘main’ section?
When I said I have run an OOT before, I meant another OOT which runs 
well in this same app. However, this is irrelevant since we are not 
talking about the same problem.

Jim
*From:* Cinaed Simson
*Sent:* Monday, December 12, 2022 12:57 AM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The main method is defined beginning on line 216 and called 4 times on 
lines 36-39.


And it appears the configparser is throwing the NoSectionError.

Try commenting out line 36 to see if line 37 throws the same exception.

When you said is has run before, did it run under python3.9?

-- Cinaed


On 12/11/22 19:11, Elmore Family wrote:
I have attached the 2 files in question. Look at the beginning of 
run_response.py. It uses ConfigParser to access the ft8_qso.conf 
configuration file.
This line seems to be the problem: my_call = str(parser.get('main', 
'my_call_sign')).
But ‘main’ is a section in the ft8_qso.conf file. Why can’t it find 
‘main’?

Jim
*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 8:52 PM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The problem appears to be in the python code

  response.py

- there is no 'main()' method.

-- Cinaed

On 12/11/22 09:48, Elmore Family wrote:

Here is the result:

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 "", line 1, in 
File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 
23, in 

from .run_response import run_response
File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", 
line 36, in 

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'

Jim

*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 12:15 AM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
Type

   python3

then enter

  import ft8

and see if it works.

-- Cinaed


On 12/9/22 18:33, Elmore's wrote:
I have created an OOT which when I incorporate it in my flowgraph 
shows the following error:

Failed to evaluate import expression ‘import ft8’
The yaml file is:
id: ft8_run_response
label: ft8
category: '[ft8]'
templates:
  imports: import ft8
  make: ft8.run_response(${ft8_button})
callbacks:
  - set_ft8(${ft8_button})
#  Make one 'parameters' list entry for every parameter you want 
settable from the GUI.

# Keys include:
# * id (makes the value accessible as keyname, e.g. in the make 
entry)

# * label (label shown in the GUI)
# * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
# * default
parameters:
- id: ft8_button
  label: ft8_button
  dtype: raw
  default: 0
# 'file_format' specifies the version of the GRC yml format used in 
the file

#  and should usually not be changed.
file_format: 1
I have developed and used an OOT before without an issue. I looked 
at the previous OOT and reviewed the GNU Radio docs on OOTs without 
seeing anything different.

I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi.
I hope someone can show me the error of my ways.
Jim

 
	Virus-free.www.avg.com 
 











Re: Import error using an OOT

2022-12-12 Thread Cinaed Simson
Opps - ft8_qso.conf is not a yaml file - it's just a  nonexcutable data 
file which the python code parses.


-- Cinaed


On 12/12/22 14:44, Cinaed Simson wrote:

No I'm not.

The ft8_qso.conf.is a data input file - or a yaml file - it is read by 
the python code.


If there's a problem with the python code, the application will crash 
and burn regardless of the content of ft8_qso.conf.


If you change the the top line in the file

  run_response.py code

from

  #!/usr/bin/env python

to

  #!/usr/bin/env python3

it should work.

-- Cinaed



On 12/12/22 06:27, Elmore Family wrote:
You are confusing main() in run_response.py with the ‘main’ section 
in ft8_qso.conf.
parser.get in line 36 is looking for the ‘main’ section but throws 
the NoSectionError.

Why can’t the parser see the ‘main’ section?
When I said I have run an OOT before, I meant another OOT which runs 
well in this same app. However, this is irrelevant since we are not 
talking about the same problem.

Jim
*From:* Cinaed Simson
*Sent:* Monday, December 12, 2022 12:57 AM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The main method is defined beginning on line 216 and called 4 times 
on lines 36-39.


And it appears the configparser is throwing the NoSectionError.

Try commenting out line 36 to see if line 37 throws the same exception.

When you said is has run before, did it run under python3.9?

-- Cinaed


On 12/11/22 19:11, Elmore Family wrote:
I have attached the 2 files in question. Look at the beginning of 
run_response.py. It uses ConfigParser to access the ft8_qso.conf 
configuration file.
This line seems to be the problem: my_call = str(parser.get('main', 
'my_call_sign')).
But ‘main’ is a section in the ft8_qso.conf file. Why can’t it find 
‘main’?

Jim
*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 8:52 PM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The problem appears to be in the python code

  response.py

- there is no 'main()' method.

-- Cinaed

On 12/11/22 09:48, Elmore Family wrote:

Here is the result:

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 "", line 1, in 
File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 
23, in 

from .run_response import run_response
File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", 
line 36, in 

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'

Jim

*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 12:15 AM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
Type

   python3

then enter

  import ft8

and see if it works.

-- Cinaed


On 12/9/22 18:33, Elmore's wrote:
I have created an OOT which when I incorporate it in my flowgraph 
shows the following error:

Failed to evaluate import expression ‘import ft8’
The yaml file is:
id: ft8_run_response
label: ft8
category: '[ft8]'
templates:
imports: import ft8
  make: ft8.run_response(${ft8_button})
callbacks:
  - set_ft8(${ft8_button})
#  Make one 'parameters' list entry for every parameter you want 
settable from the GUI.

# Keys include:
# * id (makes the value accessible as keyname, e.g. in the 
make entry)

# * label (label shown in the GUI)
# * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
# * default
parameters:
- id: ft8_button
  label: ft8_button
  dtype: raw
default: 0
# 'file_format' specifies the version of the GRC yml format used 
in the file

#  and should usually not be changed.
file_format: 1
I have developed and used an OOT before without an issue. I looked 
at the previous OOT and reviewed the GNU Radio docs on OOTs 
without seeing anything different.

I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi.
I hope someone can show me the error of my ways.
Jim

 
	Virus-free.www.avg.com 
 













Re: Import error using an OOT

2022-12-12 Thread Elmore Family
I changed the line as you requested. No difference.

From: Cinaed Simson
Sent: Monday, December 12, 2022 5:44 PM
To: Elmore Family
Cc: discuss-gnuradio@gnu.org
Subject: Re: Import error using an OOT

No I'm not.

The ft8_qso.conf.is a data input file - or a yaml file - it is read by the 
python code.

If there's a problem with the python code, the application will crash and burn 
regardless of the content of ft8_qso.conf.

If you change the the top line in the file

  run_response.py code

from

  #!/usr/bin/env python

to

  #!/usr/bin/env python3

it should work.

-- Cinaed




On 12/12/22 06:27, Elmore Family wrote:

  You are confusing main() in run_response.py with the ‘main’ section in 
ft8_qso.conf.

  parser.get in line 36 is looking for the ‘main’ section but throws the 
NoSectionError.

  Why can’t the parser see the ‘main’ section?

  When I said I have run an OOT before, I meant another OOT which runs well in 
this same app. However, this is irrelevant since we are not talking about the 
same problem.

  Jim

  From: Cinaed Simson
  Sent: Monday, December 12, 2022 12:57 AM
  To: Elmore Family
  Cc: discuss-gnuradio@gnu.org
  Subject: Re: Import error using an OOT

  The main method is defined beginning on line 216 and called 4 times on lines 
36-39.

  And it appears the configparser is throwing the NoSectionError.

  Try commenting out line 36 to see if line 37 throws the same exception.

  When you said is has run before, did it run under python3.9?

  -- Cinaed



  On 12/11/22 19:11, Elmore Family wrote:

I have attached the 2 files in question. Look at the beginning of 
run_response.py. It uses ConfigParser to access the ft8_qso.conf configuration 
file.

This line seems to be the problem: my_call = str(parser.get('main', 
'my_call_sign')).

But ‘main’ is a section in the ft8_qso.conf file. Why can’t it find ‘main’?

Jim


From: Cinaed Simson
Sent: Sunday, December 11, 2022 8:52 PM
To: Elmore Family
Cc: discuss-gnuradio@gnu.org
Subject: Re: Import error using an OOT

The problem appears to be in the python code

  response.py

- there is no 'main()' method.

-- Cinaed


On 12/11/22 09:48, Elmore Family wrote:

  Here is the result:

  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 "", line 1, in 
File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 23, 
in 
  from .run_response import run_response
File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", line 
36, in 
  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'


  Jim



  From: Cinaed Simson
  Sent: Sunday, December 11, 2022 12:15 AM
  To: discuss-gnuradio@gnu.org
  Subject: Re: Import error using an OOT

  Type

 python3

  then enter

import ft8

  and see if it works.

  -- Cinaed



  On 12/9/22 18:33, Elmore's wrote:

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

Failed to evaluate import expression ‘import ft8’

The yaml file is:

id: ft8_run_response
label: ft8
category: '[ft8]'

templates:
  imports: import ft8
  make: ft8.run_response(${ft8_button})
  callbacks:
  - set_ft8(${ft8_button})

#  Make one 'parameters' list entry for every parameter you want 
settable from the GUI.
# Keys include:
# * id (makes the value accessible as keyname, e.g. in the make 
entry)
# * label (label shown in the GUI)
# * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
# * default
parameters:
- id: ft8_button
  label: ft8_button
  dtype: raw
  default: 0

#  'file_format' specifies the version of the GRC yml format used in 
the file
#  and should usually not be changed.
file_format: 1

I have developed and used an OOT before without an issue. I looked at 
the previous OOT and reviewed the GNU Radio docs on OOTs without seeing 
anything different.

I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi.

I hope someone can show me the error of my ways.

Jim

 Virus-free.www.avg.com










--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Re: Import error using an OOT

2022-12-12 Thread Elmore's
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



--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

RE: Re: Import error using an OOT

2022-12-12 Thread Jim Melton
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 "", line 1, in 
>  File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 23, in 
> 
>from .run_response import run_response
>  File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", line 36, 
> in 
>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:  On Behalf Of Elmore's
Sent: Monday, December 12, 2022 19:14
To: de...@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



[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-green-avg-v1.png]

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.


Re: Import error using an OOT

2022-12-12 Thread Cinaed Simson

I'm not surprised the OOT doesn't work.

When running

  run_response.py

using python2 (or python), it tries to run swig which won't work under 
gnuradio 3.9 on bullseye.


Here's the error from running

   run_response.py

running under python2:

   from .runtime_swig import *
   File 
"/opt/gnuradio/lib/python3/dist-packages/gnuradio/gr/runtime_swig.py", 
line 117

   def value(self) -> "PyObject *":
   SyntaxError: invalid syntax

The OOT source code needs to be to ported gnuradio 3.9 and python3.

-- Cinaed


On 12/12/22 16:54, Elmore Family wrote:

I changed the line as you requested. No difference.
*From:* Cinaed Simson
*Sent:* Monday, December 12, 2022 5:44 PM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
No I'm not.

The ft8_qso.conf.is a data input file - or a yaml file - it is read by 
the python code.


If there's a problem with the python code, the application will crash 
and burn regardless of the content of ft8_qso.conf.


If you change the the top line in the file

  run_response.py code

from

  #!/usr/bin/env python

to

  #!/usr/bin/env python3

it should work.

-- Cinaed



On 12/12/22 06:27, Elmore Family wrote:
You are confusing main() in run_response.py with the ‘main’ section 
in ft8_qso.conf.
parser.get in line 36 is looking for the ‘main’ section but throws 
the NoSectionError.

Why can’t the parser see the ‘main’ section?
When I said I have run an OOT before, I meant another OOT which runs 
well in this same app. However, this is irrelevant since we are not 
talking about the same problem.

Jim
*From:* Cinaed Simson
*Sent:* Monday, December 12, 2022 12:57 AM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The main method is defined beginning on line 216 and called 4 times 
on lines 36-39.


And it appears the configparser is throwing the NoSectionError.

Try commenting out line 36 to see if line 37 throws the same exception.

When you said is has run before, did it run under python3.9?

-- Cinaed


On 12/11/22 19:11, Elmore Family wrote:
I have attached the 2 files in question. Look at the beginning of 
run_response.py. It uses ConfigParser to access the ft8_qso.conf 
configuration file.
This line seems to be the problem: my_call = str(parser.get('main', 
'my_call_sign')).
But ‘main’ is a section in the ft8_qso.conf file. Why can’t it find 
‘main’?

Jim
*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 8:52 PM
*To:* Elmore Family
*Cc:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
The problem appears to be in the python code

  response.py

- there is no 'main()' method.

-- Cinaed

On 12/11/22 09:48, Elmore Family wrote:

Here is the result:

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 "", line 1, in 
File "/usr/local/lib/python3.9/dist-packages/ft8/__init__.py", line 
23, in 

from .run_response import run_response
File "/usr/local/lib/python3.9/dist-packages/ft8/run_response.py", 
line 36, in 

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'

Jim

*From:* Cinaed Simson
*Sent:* Sunday, December 11, 2022 12:15 AM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: Import error using an OOT
Type

   python3

then enter

  import ft8

and see if it works.

-- Cinaed


On 12/9/22 18:33, Elmore's wrote:
I have created an OOT which when I incorporate it in my flowgraph 
shows the following error:

Failed to evaluate import expression ‘import ft8’
The yaml file is:
id: ft8_run_response
label: ft8
category: '[ft8]'
templates:
imports: import ft8
make: ft8.run_response(${ft8_button})
callbacks:
  - set_ft8(${ft8_button})
# Make one 'parameters' list entry for every parameter you want 
settable from the GUI.

# Keys include:
# * id (makes the value accessible as keyname, e.g. in the make entry)
# * label (label shown in the GUI)
# * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
# * default
parameters:
- id: ft8_button
label: ft8_button
dtype: raw
default: 0
# 'file_format' specifies the version of the GRC yml format used 
in the file

# and should usually not be changed.
file_format: 1
I have developed and used an OOT before without an issue. I looked 
at the previous OOT and reviewed the GNU Radio docs on OOTs 
without seeing anything different.

I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi.
I hope someone can show me the error of my ways.
Jim

 
	Virus-free.www.avg.com