[GNC] MacOS Mojave Python Bindings - No module named gnucash

John Ralls jralls at ceridwen.us
Sun Oct 21 22:46:20 EDT 2018



> On Oct 21, 2018, at 5:15 PM, Aaron Surrain <aaron at goodlookingsoftware.com> wrote:
> 
> I'm just getting started, running macOS Mojave, and trying to import from QuickBooks. I tried installing GNU Cash with Python Bindings per these instructions…
> 
> https://wiki.gnucash.org/wiki/MacOSX/MacPortsDetail
> 
> …and running the scripts from Jonathan Corbet's article…
> 
> https://lwn.net/Articles/729087/
> 
> …but I'm getting the error…
> 
> ImportError: No module named gnucash
> 
> …whenever I run Jonathan's script. I tried running it from the directory where I cloned it from github like this…
> $ python ./qb_iif_to_gc -c -r ~/Downloads/exportQuickBooks.IIF
> $ python2 ./qb_iif_to_gc -c -r ~/Downloads/exportQuickBooks.IIF
> $ python3 ./qb_iif_to_gc -c -r ~/Downloads/exportQuickBooks.IIF
> 
> …and a few variations without -c and -r.
> 
> Some about my environment:
> 
> $ which -a python
> /usr/local/bin/python
> /usr/bin/python
> 
> $ which -a python2
> /usr/local/bin/python2
> 
> $ which -a python3
> /usr/local/bin/python3
> 
> $ echo $PYTHONPATH
> :/opt/local/lib/python2.7/site-packages
> 
> $ ls /opt/local/lib/python2.7/site-packages/
> xcbgen

GnuCash 2.6 is Python2, GnuCash 3 is Python3. You need to build GnuCash with python bindings (-DWITH_PYTHON=YES on make, don’t remember what it was for configure but configure --help will tell you).

If you need help getting the right packages installed and GnuCash built with the right arguments you’ll have to ask on the MacPorts support channels.

Regards,
John Ralls



More information about the gnucash-user mailing list