katefike / sage

A personal finance app that's like Mint, but better. It uses a dockerized postfix/dovecot email server. Parses transaction data from alert emails.
MIT License
5 stars 0 forks source link

Fix relative imports #99

Closed katefike closed 1 year ago

katefike commented 1 year ago

Problem

(.venv) kfike@pop-os:~/Projects/sage$ python3 -m sage
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/kfike/Projects/sage/sage/__main__.py", line 3, in <module>
    from email_parser import email_parser
ModuleNotFoundError: No module named 'email_parser'

Solution

Add the parent package to each import, other than the ENV import. For example, make from db import transactions this instead from sage.db import transactions