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

Problem with gnucash file conversion #10

Open
rfaridi opened this issue May 31, 2017 · 2 comments
Open

Problem with gnucash file conversion #10

rfaridi opened this issue May 31, 2017 · 2 comments

Comments

@rfaridi
Copy link

rfaridi commented May 31, 2017

I compiled latest gnucash (2.6.16) from source with dbi conversion enabled. From gnucash I could save as sqlite3 but the files were saved as "myfile.gnucash" not "myfile.sqlite3". But I don't know whether it will have sqlite3 extension in the first place when saved. Anyway, I went ahead and ran the python script "gnucash2ledger.py" downloaded from "https://github.com/MatzeB/pygnucash" in the following manner:

python2.7 gnucash2ledger.py myfile.gnucash print > test.txt

The error came through is as follows:

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

I noticed in the script page that it says that it requires python 2.7 with sqlite3 module enabled. After some search I did the following to enable sqlite3:

sudo apt-get install sqlite3 libsqlite3-dev

sudo pip install pysqlite

But no luck so far.

@MatzeB
Copy link
Owner

MatzeB commented May 31, 2017

Hmm odd. The only way I could explain this behavior is if there is some other python package on your system called gnucash. As an experiment could you start python2.7 somewhere outside(!) the pygnucash directory and type import gnucash. This results in "ImportError: No module named gnucash" on my system. If it works for you then it would be interesting to do gnucash.__file__ to learn where the other gnucash python module is coming from.

@rfaridi
Copy link
Author

rfaridi commented May 31, 2017

I also installed a package called python-gnucash. Otherwise, it produced the following error:

Traceback (most recent call last):
File "gnucash2ledger.py", line 6, in
import gnucash
ImportError: No module named gnucash

After I installed python-gnucash, the above error was gone but the above mentioned error occurred.

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