Couldn't you just include accounts.beancount in main.beancount before banking.beancount and income.beancount? That's what I do. My main.bean (simplified) is:
; global stuff include "commodities.bean" include "accounts.bean" include "prices.bean" ; individual account history include "data/amazon_david.bean" include "data/amazon_karen.bean" include "data/amex_david.bean" include "data/amex_karen.bean" (many more individual account includes...) ... And then I don't have any other include statements in the account-specific bean files. Or does that not address your problem? On Mon, Mar 2, 2026 at 7:32 PM Aaron Stacy <[email protected]> wrote: > The beancount loader has an error if a file is imported multiple times ( > code > <https://github.com/beancount/beancount/blob/eb8be17c750257dc693e3173c30d2cabc9ab2faa/beancount/loader.py#L440> > ). > > I noticed because I was trying to organize my ledger something like this: > > [image: ledger_deps.png] > > And got the error. I want each of banking.beancount and income.beancount > to include accounts.beancount because my editor plugin will give me errors > if I don't (since the accounts aren't defined). > > Looks like this functionality has been around just about as long as the > include directive (commit > <https://github.com/beancount/beancount/commit/1ad7017ca8bba9af7e13ed6613c28f14126b0ea7>), > and I couldn't find any docs on why this would be an error. > > When I remove the error, the loading logic seems to work fine. Any chance > I could mail a PR to remove this error? > > -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/beancount/CACjABknxqNpEK0EgQK7PVh76sUkO41hF%2B6QxSTR91D6U9Z4kag%40mail.gmail.com > <https://groups.google.com/d/msgid/beancount/CACjABknxqNpEK0EgQK7PVh76sUkO41hF%2B6QxSTR91D6U9Z4kag%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/beancount/CAN5otWNROPuhtxBwE%3D8Fj0wxW9WAQcy3yaFpbPBnZ1aavVjcng%40mail.gmail.com.
