trouble building wxPython

Hi all,
    So I finally got things loaded. I used the RPMs for fc7 py2.5 and used the
ansi versions:
wxPython-common-gtk2-ansi-2.8.9.1-fc7_py2.5.i386.rpm*
wxPython2.8-devel-gtk2-ansi-2.8.9.1-fc7_py2.5.i386.rpm*
wxPython2.8-gtk2-ansi-2.8.9.1-fc7_py2.5.i386.rpm*
  
I did:
rpm -i -f --nodeps *rpm

And everything loaded.
I previously rebuilt python2.5 --without-unicode

I started python2.5 and did

sys.path

['', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
'/usr/local/lib/python2.5/plat-linux2', '/usr/local/lib/python2.5/lib-tk',
'/usr/local/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi',
'/MNSN/Temp/pySrc/utilSrc']

which looks correct
then I did

os.chdir("/usr/local/src/wxPython-src-2.8.9.1/wxPython/demo/")
execfile("demo.py")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "demo.py", line 3, in <module>
    import Main
  File "/usr/local/src/wxPython-src-2.8.9.1/wxPython/demo/Main.py", line 34, in
<module>
    import wx
  File
"/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/__init__.py", line
45, in <module>
    from wx._core import *
  File "/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/_core.py",
line 4, in <module>
    import _core_
ImportError:
/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/_core_.so: undefined
symbol: PyUnicodeUCS4_AsEncodedString

how do I get rid of this?

I tried modifying demo.py by adding the lines
import wxversion
wxversion.select('2.8-gtk2-ansi')

to Main.py but that had no effect.

I tried rebuilding the wxPython package from source being sure that it was only
ansi and I got the following
when I tried to run demo.py
Traceback (most recent call last):
  File "demo.py", line 3, in <module>
    import Main
  File "/usr/local/src/wxPython-src-2.8.9.1/wxPython/demo/Main.py", line 39, in
<module>
    import wx
  File
"/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/__init__.py", line
45, in <module>
    from wx._core import *
  File "/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: libwx_gtk2ud_richtext-2.8.so.0: cannot open shared object file: No
such file or directory

I'm lost the file libwx_gtk2ud_richtext-2.8.so.0 looks like a unicode double
wide version of the library. There is a libwx_gtk2_richtext-2.8.so.0 library
and if I make the ud a link to it I get another
ImportError: libwx_gtk2ud_aui-2.8.so.0: cannot open shared object file: No such
file or directory

Why is it trying to use the ud libraries I built using unicode NO and did the
setup.py with UNICODE=0

I'm totally lost at this point I've tried loading from RPMs, source, with
unicode4, without unicode
nothing works. when I did --with-unicode=UCS4 in everthing the demo code ran
and immediately crashed with an x11 error BAD_PARAMETER.

Nick
nbuchholz@noao.edu
Day phone: (520) 318-8203
"Time is an illusion, Lunchtime doubly so" - Ford Prefect
Time is an illusion perpetrated by the manufacturers of space.

Nick Buchholz wrote:

ImportError:
/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/_core_.so: undefined
symbol: PyUnicodeUCS4_AsEncodedString

how do I get rid of this?

You will need to build your own RPMs so they will match the Python installed on your system. Python has a configuration option that will cause the build to not be binary compatible with extensions built with a Python that used the other option. The option controls whether the Unicode objects are composed of USC2 characters or UCS4 characters, and some API functions are #defined differently depending on the setting, and that results in missing symbols if mismatched extension uses those APIs.

In your case Python was apparently built with the UCS2 setting and the wxPython you used was built using a Python that used the UCS4 setting.

I tried modifying demo.py by adding the lines import wxversion
wxversion.select('2.8-gtk2-ansi')

to Main.py but that had no effect.

The Python Unicode APIs are used in either wx build, although for slightly different conversion needs. So using an ansi vs. unicode build of wxPython won't make any difference for this particular issue. See http://wiki.wxpython.org/UnicodeBuild

I tried rebuilding the wxPython package from source being sure that it was only
ansi and I got the following when I tried to run demo.py
Traceback (most recent call last):
  File "demo.py", line 3, in <module>
    import Main
  File "/usr/local/src/wxPython-src-2.8.9.1/wxPython/demo/Main.py", line 39, in
<module>
    import wx File
"/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/__init__.py", line
45, in <module>
    from wx._core import *
  File "/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: libwx_gtk2ud_richtext-2.8.so.0: cannot open shared object file: No
such file or directory

I'm lost the file libwx_gtk2ud_richtext-2.8.so.0 looks like a unicode double
wide version of the library.

Almost. The 'ud' means Unicode mode and debug flag.

There is a libwx_gtk2_richtext-2.8.so.0 library
and if I make the ud a link to it I get another

Don't do that. They are not binary compatible.

ImportError: libwx_gtk2ud_aui-2.8.so.0: cannot open shared object file: No such
file or directory

Why is it trying to use the ud libraries I built using unicode NO and did the
setup.py with UNICODE=0

Did you also disable unicode when you did the wxWidgets part of the build?

I'm totally lost at this point I've tried loading from RPMs, source, with
unicode4, without unicode
nothing works. when I did --with-unicode=UCS4 in everthing the demo code ran
and immediately crashed with an x11 error BAD_PARAMETER.

Have you tried making your own RPMs with rpmbuild as I suggested in the other mail? It really will take care of everything for you and you won't have to worry about any of this. You'll just have to install the RPMs it produces. They will include wxWidgets and wxPython and will be built for the Python on your system.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Have you tried making your own RPMs with rpmbuild as I suggested in the other mail? It really will take care of everything for you and you won't have to worry about any of this. You'll just have to install the RPMs it produces. They will include wxWidgets and wxPython and will be built for the Python on your system.

Another possible approach to take would be to grab the stock wxGTK and wxPython SRPMs from a Fedora mirror and build them. For example:

http://archive.linux.duke.edu/pub/fedora/linux/releases/9/Everything/source/SRPMS/

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!