Opened 13 years ago

Closed 10 years ago

#33896 closed enhancement (fixed)

gnucash: add support for building python bindings

Reported by: reubano (Reuben Cummings) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc: nbenm
Port: gnucash

Description

gnucash-2.4.10 built from source with MacPorts 2.0.4 on MacOSX 10.7.2

I get the following error when trying to use gnucash python bindings

gnucash-env ipython
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
Type "copyright", "credits" or "license" for more information.

IPython 0.12 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import gnucash.gnucash_core
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/Users/reubano/<ipython-input-1-d3675276f3f3> in <module>()
----> 1 import gnucash.gnucash_core

/opt/x11/lib/python2.7/site-packages/gnucash/__init__.py in <module>()
      4 # instead of

      5 # >>> from gnucash.gnucash_core import thingy

----> 6 from gnucash_core import *
      7 ##  @file

      8 #   @brief helper file for the importing of gnucash


/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core.py in <module>()
     29 #  @ingroup python_bindings

     30 
---> 31 import gnucash_core_c
     32 
     33 from function_class import \

/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core_c.py in <module>()
     23                 fp.close()
     24             return _mod
---> 25     _gnucash_core_c = swig_import_helper()
     26     del swig_import_helper
     27 else:

/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core_c.py in swig_import_helper()
     19         if fp is not None:
     20             try:
---> 21                 _mod = imp.load_module('_gnucash_core_c', fp, pathname, description)
     22             finally:
     23                 fp.close()

ImportError: dlopen(/opt/x11/lib/python2.7/site-packages/gnucash/_gnucash_core_c.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/x11/lib/libJPEG.dylib
 in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

I received similar errors when building gnucash but those went away once I ran

export DYLD_FALLBACK_LIBRARY_PATH=/opt/x11/lib:

The current error appears whether I have DYLD_FALLBACK_LIBRARY_PATH set or not.

Additionally, I was able to work around this (and a similar error in libTIFF.dylib) by symlinking to the corresponding dylib in /System/Library/Frameworks.... However, I then reached the following

In [1]: import gnucash.gnucash_core
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/Users/reubano/<ipython-input-1-d3675276f3f3> in <module>()
----> 1 import gnucash.gnucash_core

/opt/x11/lib/python2.7/site-packages/gnucash/__init__.py in <module>()
      4 # instead of

      5 # >>> from gnucash.gnucash_core import thingy

----> 6 from gnucash_core import *
      7 ##  @file

      8 #   @brief helper file for the importing of gnucash


/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core.py in <module>()
     29 #  @ingroup python_bindings

     30 
---> 31 import gnucash_core_c
     32 
     33 from function_class import \

/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core_c.py in <module>()
     23                 fp.close()
     24             return _mod
---> 25     _gnucash_core_c = swig_import_helper()
     26     del swig_import_helper
     27 else:

/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core_c.py in swig_import_helper()
     19         if fp is not None:
     20             try:
---> 21                 _mod = imp.load_module('_gnucash_core_c', fp, pathname, description)
     22             finally:
     23                 fp.close()

ImportError: dlopen(/opt/x11/lib/python2.7/site-packages/gnucash/_gnucash_core_c.so, 2): Symbol not found: __cg_png_create_info_struct
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/x11/lib/libpng14.14.dylib
 in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

and there is no libpng14.14.dylib in /System/Library/Frameworks. I also rebuilt the libs using the +universal variants as well.

Change History (12)

comment:1 Changed 13 years ago by mf2k (Frank Schima)

Keywords: gnucash python libJPEG.dylib removed
Owner: changed from macports-tickets@… to dports@…

comment:2 Changed 12 years ago by drkp (Dan Ports)

The gnucash port doesn't build python bindings; how did you install them?

comment:3 Changed 12 years ago by drkp (Dan Ports)

Status: newassigned
Summary: gnucash python bindings import errorgnucash: add support for building python bindings
Type: defectenhancement

comment:4 Changed 12 years ago by drkp (Dan Ports)

Resolution: fixed
Status: assignedclosed

Added +python27 variant in r95009

comment:5 Changed 12 years ago by reubano (Reuben Cummings)

Resolution: fixed
Status: closedreopened

gnucash @2.4.10_2+dbi+hbci+ofx+python27 (active)

reubano@tokpro [~]$ /opt/x11/bin/gnucash-env ipython
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
Type "copyright", "credits" or "license" for more information.

IPython 0.12 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import gnucash.gnucash_core
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/Users/reubano/<ipython-input-1-d3675276f3f3> in <module>()
----> 1 import gnucash.gnucash_core

/opt/x11/lib/python2.7/site-packages/gnucash/__init__.py in <module>()
      4 # instead of

      5 # >>> from gnucash.gnucash_core import thingy

----> 6 from gnucash_core import *
      7 ##  @file

      8 #   @brief helper file for the importing of gnucash


/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core.py in <module>()
     29 #  @ingroup python_bindings

     30 
---> 31 import gnucash_core_c
     32 
     33 from function_class import \

/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core_c.py in <module>()
     23                 fp.close()
     24             return _mod
---> 25     _gnucash_core_c = swig_import_helper()
     26     del swig_import_helper
     27 else:

/opt/x11/lib/python2.7/site-packages/gnucash/gnucash_core_c.py in swig_import_helper()
     19         if fp is not None:
     20             try:
---> 21                 _mod = imp.load_module('_gnucash_core_c', fp, pathname, description)
     22             finally:
     23                 fp.close()

ImportError: dlopen(/opt/x11/lib/python2.7/site-packages/gnucash/_gnucash_core_c.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/x11/lib/libJPEG.dylib
 in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

comment:6 Changed 12 years ago by reubano (Reuben Cummings)

comment:7 Changed 12 years ago by drkp (Dan Ports)

Try it without the gnucash-env, just ipython

comment:8 Changed 12 years ago by reubano (Reuben Cummings)

Thanks, that works. Awesome!

comment:9 Changed 12 years ago by drkp (Dan Ports)

Resolution: fixed
Status: reopenedclosed

Cool, glad to hear it!

comment:10 Changed 10 years ago by nbenm

Hello,

The problem seem to have reappear. There's no variant python27 and python bindings are unavailable. So I reopen this bug. Here are somme informations:

$ port variants gnucash-devel
gnucash-devel has the variants:
   dbi: Adds dbi backend support
[+]hbci: AqBanking/HBCI support
[+]ofx: OFX support
$ port variants gnucash
gnucash has the variants:
   dbi: Adds dbi backend support
[+]hbci: AqBanking/HBCI support
[+]ofx: OFX support

so python27 is neither in gnucash nor in gnucash devel.

I'm very new to OsX, so I don't know what to do now. I would like to use the python code I wrote on my debian, I'm leaving for a MacBook.

Thanks in advance

Regards

nb

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:11 Changed 10 years ago by nbenm

Resolution: fixed
Status: closedreopened

comment:12 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: nb@… added
Resolution: fixed
Status: reopenedclosed

This ticket was resolved 2 years ago, but the variant was subsequently removed because it stopped working. See #43254 for the current status of this variant.

Note: See TracTickets for help on using tickets.