|
From: | Elmore Family |
Subject: | Re: Import error using an OOT |
Date: | Tue, 13 Dec 2022 21:52:31 -0500 |
Jim,
Thanks for jumping in. You got me focused on the real issue. I put the path
to the file in config.read() and everything now works.
I let myself wander off the path to the real problem (pun intended).
Thanks also for Johannes’ comment regarding ‘./’.
Jim
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 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 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 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. |
[Prev in Thread] | Current Thread | [Next in Thread] |