Ticket #33896 (closed enhancement: fixed)
gnucash: add support for building python bindings
| Reported by: | reubano@… | Owned by: | dports@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.0.4 |
| Keywords: | Cc: | ||
| 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
comment:1 Changed 13 months ago by macsforever2000@…
- Owner changed from macports-tickets@… to dports@…
- Keywords gnucash, python, libJPEG.dylib removed
comment:2 Changed 11 months ago by dports@…
The gnucash port doesn't build python bindings; how did you install them?
comment:3 Changed 11 months ago by dports@…
- Status changed from new to assigned
- Type changed from defect to enhancement
- Summary changed from gnucash python bindings import error to gnucash: add support for building python bindings
comment:4 Changed 11 months ago by dports@…
- Status changed from assigned to closed
- Resolution set to fixed
Added +python27 variant in r95009
comment:5 Changed 11 months ago by reubano@…
- Status changed from closed to reopened
- Resolution fixed deleted
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 11 months ago by reubano@…
followed instructions from http://wiki.gnucash.org/wiki/Python_Bindings

