wxpython import _core_ error

It seems that almost every new version of wxPython I try involves spending
days trying to get the build to work! Sigh, if there was a way for me to
dump the application and move on to something better for a GUI, I'd have
done it a long time ago.

This is perhaps the final straw....if this doesn't work, please tell me how
to port the GUI to something else. I love Python, but the wxPython module
makes me question why I ever did GUI work in python.

After the failures in building previous versions of wxPython, I have
attempted to build in a path other than /usr/local so as not to pollute the
tree with this wxPython.

So, on to the problem: The system is a 64 bit RedHat machine. I have had to
build GTK from scratch, plus wxWidgets 2.8 and all the related modules. I
built wxPython 2.8.9.2 with no GL (BUILD_GLCANVAS = 0) .. and no apparent
problems.

On import wx, I get the following error:

ImportError:
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so:
undefined symbol: _ZN5wxApp10InitializeERiPPw

Now, I am using the right wx-config, the LD_LIBRARY_PATH is pointing to the
right place, everything is built with unicode and, yes, the PYTHONPATH IS
set properly.

The installation is Here: /peasd/fesg/users/apps/linux64/usr/local/lib
  wx-config --version
2.8.9

   wx-config --libs
-L/peasd/fesg/users/apps/linux64/usr/local/lib -pthread -L/usr/X11R6/lib64
-lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8
-lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8
-lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8

   echo $LD_LIBRARY_PATH
/peasd/fesg/users/apps/srcs/srcs/databases/instantclient_10_2:/peasd/fesg/users/apps/srcs/VTK5bin/bin:/peasd/fesg/users/apps/linux64/usr/local/lib:/peasd/fesg/users/apps/linux64/usr/local/bin:/ep/appl01/ep/orabase_lnx/ora10G_lnx/lib:/csd/appl/opt/lib:/usr/lib

Simply, supporting an application built under WxPython is a real pain to
update and I wish there was a cleaner procedure.

···

--
View this message in context: http://www.nabble.com/wxpython-import-core-error-tp22522941p22522941.html
Sent from the wxPython-users mailing list archive at Nabble.com.

I've never run into this exact problem, but I spent a long month
trying to build it with all kind of strange problems.

This was the steps I followed to successfully build mine, I hope it helps:

$ cd ~
$ wget http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.9.2.tar.bz2
$ tar xvf wxPython-src-2.8.9.2.tar.bz2
$ cd wxPython-src-2.8.9.2
$ mkdir bld
$ cd bld
$ ../configure \
--prefix=/opt/wx/2.8 \
--with-gtk
--with-gnomeprint \
--with-opengl \
--enable-optimize \
--enable-debug_gdb \
--enable-geometry \
--enable-graphics_ctx \
--enable-sound --with-sdl \
--enable-mediactrl \
--enable-display \
--enable-unicode \
--enable-debug_flag \
$ make && make -C contrib/src/gizmos && make -C contrib/src/stc
# make install && make -C contrib/src/gizmos install && make -C
contrib/src/stc install
$ PATH=$PATH:/opt/wx/2.8/bin
$ export PATH
$ LD_LIBRARY_PATH=/opt/wx/2.8/lib
$ export LD_LIBRARY_PATH
$ ldconfig
$ cd ../wxPython
$ python setup.py WX_CONFIG="/opt/wx/2.8/bin/wx-config" BUILD_GLCANVAS="0" build
# python setup.py install build_ext --inplace

Thank you. I will attempt it again ;-).

I had to disable gtk-test for the build to proceed and build gtk2.14.0 from
scratch.

Will let you know if there is something else.

Now about that IronPython interface.. or pyqt .... hmm.

Lucas Boppre Niehues wrote:

···

I've never run into this exact problem, but I spent a long month
trying to build it with all kind of strange problems.

This was the steps I followed to successfully build mine, I hope it helps:

$ cd ~
$ wget
http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.9.2.tar.bz2
$ tar xvf wxPython-src-2.8.9.2.tar.bz2
$ cd wxPython-src-2.8.9.2
$ mkdir bld
$ cd bld
$ ../configure \
--prefix=/opt/wx/2.8 \
--with-gtk
--with-gnomeprint \
--with-opengl \
--enable-optimize \
--enable-debug_gdb \
--enable-geometry \
--enable-graphics_ctx \
--enable-sound --with-sdl \
--enable-mediactrl \
--enable-display \
--enable-unicode \
--enable-debug_flag \
$ make && make -C contrib/src/gizmos && make -C contrib/src/stc
# make install && make -C contrib/src/gizmos install && make -C
contrib/src/stc install
$ PATH=$PATH:/opt/wx/2.8/bin
$ export PATH
$ LD_LIBRARY_PATH=/opt/wx/2.8/lib
$ export LD_LIBRARY_PATH
$ ldconfig
$ cd ../wxPython
$ python setup.py WX_CONFIG="/opt/wx/2.8/bin/wx-config" BUILD_GLCANVAS="0"
build
# python setup.py install build_ext --inplace
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
View this message in context: http://www.nabble.com/wxpython-import-_core_-error-tp22522941p22531671.html
Sent from the wxPython-users mailing list archive at Nabble.com.

kbhusain wrote:

It seems that almost every new version of wxPython I try involves spending
days trying to get the build to work! Sigh, if there was a way for me to
dump the application and move on to something better for a GUI, I'd have
done it a long time ago.

This is perhaps the final straw....if this doesn't work, please tell me how
to port the GUI to something else. I love Python, but the wxPython module
makes me question why I ever did GUI work in python.

After the failures in building previous versions of wxPython, I have
attempted to build in a path other than /usr/local so as not to pollute the
tree with this wxPython.

So, on to the problem: The system is a 64 bit RedHat machine. I have had to
build GTK from scratch, plus wxWidgets 2.8 and all the related modules. I
built wxPython 2.8.9.2 with no GL (BUILD_GLCANVAS = 0) .. and no apparent
problems.

On import wx, I get the following error:

ImportError:
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so:
undefined symbol: _ZN5wxApp10InitializeERiPPw

Now, I am using the right wx-config, the LD_LIBRARY_PATH is pointing to the
right place, everything is built with unicode and, yes, the PYTHONPATH IS
set properly.

Ok, let's see what is in the lib instead of what it is looking for, and that might give us a clue as to what is going wrong in the build. First use this command to ensure that it really is looking in the right place for the wx shared libs with your environment settings.

     ldd /peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so

It should show that it is loading (among others) the libwx_gtk2u_core lib from /peasd/fesg/users/apps/linux64/usr/local/lib.

Now the next step is to see what symbol was actually put into the lib for the wxApp::Initialize function. C++ symbols are "mangled" based on things like parameter types, and that can change in wx based on platform and build options as #defines and typdefs will be evaluated differently. You can use the nm tool to see what symbols are in the lib, what type they are, and etc. Run these commands:

     cd /peasd/fesg/users/apps/linux64/usr/local/lib
     nm libwx_gtk2ud_core-2.8.so | grep wxApp | grep Initialize | grep " T "

You'll get something like this, although the codes before or after the names will be different since you are getting an undefined symbol error. It's that difference that we are interested in.

0019a006 T _ZN5wxApp10InitializeERiPPw
0027d438 T _ZN9wxAppBase10InitializeERiPPw

You can use the c++filt command to see what the unmangled name is:

     c++filt _ZN5wxApp10InitializeERiPPw
     wxApp::Initialize(int&, wchar_t**)

Let me know what you get.

···

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

[husainkb@lnx_eob_7w107 lib]$ nm libwx_gtk2u_core-2.8.so | grep wxApp | grep
Initial | grep " T "
00000000001b7fa0 T _ZN5wxApp10InitializeERiPPw
00000000002529f0 T _ZN9wxAppBase10InitializeERiPPw
[husainkb@lnx_eob_7w107 lib]$ c++filt
_ZN5wxApp10InitializeERiPPw
wxApp::Initialize(int&, wchar_t**)
_ZN9wxAppBase10InitializeERiPPw
wxAppBase::Initialize(int&, wchar_t**)

Also, nm libwx_gtk2u_core-2.8.so | grep "WXU_2.8.8

reveals nothing. Where is this symbol defined?

This is the library picked up the core.so library. The results from the ldd
command referred to a missing WXU_2.8.8 and also the WXU_2.8.10 variable. My
apologies for the long post, but it may help.

<snip>
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so:
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_core-2.8.so.0:
version `WXU_2.8.10' not found (required by
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so)
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so:
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_core-2.8.so.0:
version `WXU_2.8.8' not found (required by
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so)
        libwx_gtk2u_richtext-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_richtext-2.8.so.0
(0x0000002a957ea000)
        libwx_gtk2u_aui-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_aui-2.8.so.0
(0x0000002a95a0a000)
        libwx_gtk2u_xrc-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_xrc-2.8.so.0
(0x0000002a95b68000)
        libwx_gtk2u_qa-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_qa-2.8.so.0
(0x0000002a95d04000)
        libwx_gtk2u_html-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_html-2.8.so.0
(0x0000002a95e28000)
        libwx_gtk2u_adv-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_adv-2.8.so.0
(0x0000002a95fdb000)
        libwx_gtk2u_core-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_gtk2u_core-2.8.so.0
(0x0000002a961c2000)
        libwx_baseu_xml-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_baseu_xml-2.8.so.0
(0x0000002a966c1000)
        libwx_baseu_net-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_baseu_net-2.8.so.0
(0x0000002a967cb000)
        libwx_baseu-2.8.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libwx_baseu-2.8.so.0
(0x0000002a968fe000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000002a96b97000)
        libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a96d87000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000002a96f0e000)
        libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a97019000)
        libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a9712e000)
        libz.so.1 => /usr/lib64/libz.so.1 (0x0000002a97363000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000002a97476000)
        libgtk-x11-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgtk-x11-2.0.so.0
(0x0000002a97579000)
        libgdk-x11-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgdk-x11-2.0.so.0
(0x0000002a97a45000)
        libatk-1.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libatk-1.0.so.0
(0x0000002a97bdd000)
        libgio-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgio-2.0.so.0
(0x0000002a97cfd000)
        libpangoft2-1.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libpangoft2-1.0.so.0
(0x0000002a97e6b000)
        libgdk_pixbuf-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgdk_pixbuf-2.0.so.0
(0x0000002a97f97000)
        libpango-1.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libpango-1.0.so.0
(0x0000002a980b0000)
        libfreetype.so.6 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libfreetype.so.6
(0x0000002a981f8000)
        libfontconfig.so.1 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libfontconfig.so.1
(0x0000002a98378000)
        libgobject-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgobject-2.0.so.0
(0x0000002a984a8000)
        libgmodule-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgmodule-2.0.so.0
(0x0000002a985eb000)
        libgthread-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libgthread-2.0.so.0
(0x0000002a986ee000)
        librt.so.1 => /lib64/tls/librt.so.1 (0x0000002a987f2000)
        libglib-2.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libglib-2.0.so.0
(0x0000002a9890d000)
        libXinerama.so.1 => /usr/X11R6/lib64/libXinerama.so.1
(0x0000002a98ae1000)
        libXxf86vm.so.1 => /usr/X11R6/lib64/libXxf86vm.so.1
(0x0000002a98be3000)
        libSM.so.6 => /usr/X11R6/lib64/libSM.so.6 (0x0000002a98ce9000)
        libpng12.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libpng12.so.0
(0x0000002a98df3000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x0000002a98f17000)
        libtiff.so.3 => /usr/lib64/libtiff.so.3 (0x0000002a99039000)
        libexpat.so.0 => /usr/lib64/libexpat.so.0 (0x0000002a9918c000)
        /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)
        libXrender.so.1 => /usr/X11R6/lib64/libXrender.so.1
(0x0000002a992af000)
        libX11.so.6 => /usr/X11R6/lib64/libX11.so.6 (0x0000002a993b8000)
        libpangocairo-1.0.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libpangocairo-1.0.so.0
(0x0000002a995b1000)
        libcairo.so.2 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libcairo.so.2
(0x0000002a996bd000)
        libXext.so.6 => /usr/X11R6/lib64/libXext.so.6 (0x0000002a99831000)
        libICE.so.6 => /usr/X11R6/lib64/libICE.so.6 (0x0000002a99943000)
        libpixman-1.so.0 =>
/peasd/fesg/users/apps/linux64/usr/local/lib/libpixman-1.so.0
(0x0000002a99a5e000)
</snip>

kbhusain wrote:

···

It seems that almost every new version of wxPython I try involves spending
days trying to get the build to work! Sigh, if there was a way for me to
dump the application and move on to something better for a GUI, I'd have
done it a long time ago.

This is perhaps the final straw....if this doesn't work, please tell me
how to port the GUI to something else. I love Python, but the wxPython
module makes me question why I ever did GUI work in python.

After the failures in building previous versions of wxPython, I have
attempted to build in a path other than /usr/local so as not to pollute
the tree with this wxPython.

So, on to the problem: The system is a 64 bit RedHat machine. I have had
to build GTK from scratch, plus wxWidgets 2.8 and all the related modules.
I built wxPython 2.8.9.2 with no GL (BUILD_GLCANVAS = 0) .. and no
apparent problems.

On import wx, I get the following error:

ImportError:
/peasd/fesg/users/apps/linux64/usr/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so:
undefined symbol: _ZN5wxApp10InitializeERiPPw

Now, I am using the right wx-config, the LD_LIBRARY_PATH is pointing to
the right place, everything is built with unicode and, yes, the PYTHONPATH
IS set properly.

The installation is Here: /peasd/fesg/users/apps/linux64/usr/local/lib
  wx-config --version
2.8.9

   wx-config --libs
-L/peasd/fesg/users/apps/linux64/usr/local/lib -pthread
-L/usr/X11R6/lib64 -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8
-lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8
-lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8
-lwx_baseu_net-2.8 -lwx_baseu-2.8

   echo $LD_LIBRARY_PATH
/peasd/fesg/users/apps/srcs/srcs/databases/instantclient_10_2:/peasd/fesg/users/apps/srcs/VTK5bin/bin:/peasd/fesg/users/apps/linux64/usr/local/lib:/peasd/fesg/users/apps/linux64/usr/local/bin:/ep/appl01/ep/orabase_lnx/ora10G_lnx/lib:/csd/appl/opt/lib:/usr/lib

Simply, supporting an application built under WxPython is a real pain to
update and I wish there was a cleaner procedure.

--
View this message in context: http://www.nabble.com/wxpython-import-_core_-error-tp22522941p22553746.html
Sent from the wxPython-users mailing list archive at Nabble.com.

kbhusain wrote:

[husainkb@lnx_eob_7w107 lib]$ nm libwx_gtk2u_core-2.8.so | grep wxApp | grep
Initial | grep " T "
00000000001b7fa0 T _ZN5wxApp10InitializeERiPPw

I'm confused. Isn't this the same symbol that was reported as undefined
in your original message?

00000000002529f0 T _ZN9wxAppBase10InitializeERiPPw
[husainkb@lnx_eob_7w107 lib]$ c++filt _ZN5wxApp10InitializeERiPPw
wxApp::Initialize(int&, wchar_t**)
_ZN9wxAppBase10InitializeERiPPw
wxAppBase::Initialize(int&, wchar_t**)

Also, nm libwx_gtk2u_core-2.8.so | grep "WXU_2.8.8

reveals nothing. Where is this symbol defined?

That is a tag that wx uses to add version info to new symbols added in
the minor releases. I don't know all of the theory and reasons behind
using them, but you really shouldn't have a problem with not finding
them if the wxPython extensions were just linked with the same libs. (I
think that the version tags are normally used to help with allowing
newer libs to be used with older executables...)

Are you sure that the wxPython build used those libs when it linked the
extension modules?

···

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