Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: 'gnucash' has no attribute 'read_file' #12

Open
pedroalbanese opened this issue Aug 4, 2020 · 2 comments
Open

Error: 'gnucash' has no attribute 'read_file' #12

pedroalbanese opened this issue Aug 4, 2020 · 2 comments

Comments

@pedroalbanese
Copy link

Hi; I'm trying to run gnucash2ledger.py in Python3, already typed import gnucash, I'm getting this error:

Traceback (most recent call last):
File "gnucash2ledger.py", line 34, in
data = gnucash.read_file(sys.argv[1])
AttributeError: module 'gnucash' has no attribute 'read_file'

how should I proceed? Help me plz

Thanks in advance.

@MatzeB
Copy link
Owner

MatzeB commented Aug 4, 2020

I think gnucash, is shipping with its own python API nowadays that is calso called gnucash. It seems this is producing problems for some users in that they end up importing the gnucash provided API rather than the one coming with the pygnucash project.

You can probably confirm my theory by doing something like print(gnucash.__file__) that should show you which file was used to provide the gnucash module.

Unfortunately I don't really have the time right now to investigate why one or the other API may be used, find the time to rename my API to use a different name that does not clash. But hopefully this is enough information for you to debug things on your own or patch on your own.

@pedroalbanese
Copy link
Author

'gnucash.file' becomes '/usr/lib/python3/dist-packages/gnucash/init.py'

it is the only module that it tries to import .. if I do not import this module the program gives an error saying it did not find the gnucash module.

How can I get around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants