Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can't get Python import to work inside the import-config file #2271

Open

Description

I'm getting the following error when trying beangulp example importers with Fava:

Error in import config '/home/qqq/beangulp/examples/import.py': Traceback (most recent call last):
 File "/home/qqq/beancount/.venv/lib/python3.12/site-packages/fava/core/ingest.py", line 331, in load_import_config
 mod = run_path(str(module_path))
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "<frozen runpy>", line 286, in run_path
 File "<frozen runpy>", line 98, in _run_module_code
 File "<frozen runpy>", line 88, in _run_code
 File "/home/qqq/beangulp/examples/import.py", line 3, in <module>
 from importers import acme
ModuleNotFoundError: No module named 'importers'

I've added the import-config option to the ledger file as follows:

2000年01月01日 custom "fava-option" "import-config" "../import.py"

This line seems to be effective because import.py is obviously invoked by Fava, but it's having trouble finding the Python modules that are in the same directory as import.py.

What am I missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /