|
ChartDirector installation |
Posted by Ricardo Juarez on Jun-11-2011 03:18 |
|
Hi!
Just a newbie here and I wanted to try out some of the demos of ChartDirector.
I have a problem with the installation. I just copied the contents of the ChartDirector/lib folder in a reachable "python path" and whenenever I try to execute any of the examples I get the following error:
ImportError: /usr/lib/python3.2/pychartdir32.so: undefined symbol: PyUnicodeUCS2_FromString
Can you please help me? I just copied the ChartDirector libraries into /usr/lib/python3.2, which is reachable by python:
[arch@pedrito pythondemo]$ python -c "import sys;print(sys.path)"
['', '/usr/lib/python32.zip', '/usr/lib/python3.2', '/usr/lib/python3.2/plat-linux2', '/usr/lib/python3.2/lib-dynload', '/usr/lib/python3.2/site-packages', '/usr/lib/python3.2/site-packages/setuptools-0.6c11.egg-info']
Thanks!
Best regards,
Ricardo Ju?rez. |
Re: ChartDirector installation |
Posted by Peter Kwan on Jun-13-2011 20:03 |
|
Hi Ricardo,
Thanks for informing us of this issue. The issue is because your Python 3.2 interpreter is configured and compiled using 4-bytes unicode (UCS4 - 4 bytes per character). but the current ChartDirector is compiled assuming a Python interpreter using 2-byte unicode (UCS2 - 2 bytes per character).
Like many open source software, there are many ways to compile the Python interpreter (using different "configure" options), and they can be binary incompatible. By default, Python 3.x will use 2-byte unicode, and ChartDirector for Python is compiled based on 2-byte unicode. However, in your case, it appears your Python interpreter is using 4-byte unicode, which is binary incompatible with 2-byte unicode, and so cannot loaded the ChartDirector Python extension.
To address this problem, we have just recompile "ChartDirector for Python for Linux" so that it works with both UCS2 and UCS4 and uploaded to our web site.
So for your case, there are 2 solutions:
(a) If the Python 3.2 interpreter is compiled by yourself, you may consider to recompile it using the 2-byte unicode option.
or
(b) You may download the "ChartDirector for Python for Linux" again from our web site. The latest update should work with your Python.
Hope this can help.
Regards
Peter Kwan |
Re: ChartDirector installation |
Posted by Bill Harris on Aug-25-2011 02:33 |
|
Peter,
I'm getting the same message "Undefined symbol "PyUnicodeUCS2_FromString on
my install on FreeBSD 64, with the Python3 installed from a FreeBSD package (pkg_add -r python31)..
Python2.6 is installed (previously) and it does load correctly.
Apparently FreeBSD decided to go to 4 byte on Python 3.. Obvioiusly, I can build
Python 3.2 from source with 2 byte unicode, but that's not really portable.
Suggestions?
Would it be reasonable to re-compile ChartDirector for 3.x distributions to default to 4 byte unicode? Leave the 2.x as-is, and it would then be compatible with the default packages?
Bill |
Re: ChartDirector installation |
Posted by Bill Harris on Aug-25-2011 02:34 |
|
Note, that was FreeBSD 8.2, 64bit version.
Bill |
Re: ChartDirector installation |
Posted by Peter Kwan on Aug-26-2011 00:41 |
|
Hi Bill,
Thanks for your information that FreeBSD now defaults to 4 byte unicode in Python 3.x.
ChartDirector for Python 5.0.2 uses the "default number of bytes" for unicode. (If you compile Python 3.x using "./configure" and "make" without any option, it defaults to 2 bytes unicode.) We do this because when Python 3.x first comes out, most people will download and compile Python themselves, and it is likely they will use the Python default of 2 bytes unicode. Even today, if a new Python version comes out and it is not yet available as a FreeBSD package, most people will download and compile it themselves, resulting in 2 bytes unicode.
Anyway, we are aware of this issue for some time. I have just uploaded an updated version of ChartDirector for Python to our web site. It is designed to work with both 2 bytes and 4 bytes unicode. It should work with the Python 3.x in the FreeBSD package, as well as privately compiled Python, and is compatible with earlier ChartDirector releases.
Please kindly download "ChartDirector for Python" again from our web site, and use the updated "pychartdir??.so" to replace your existing files of the same name.
Hope this can help.
Regards
Peter Kwan |
|