wxPython symbol error (ImageHandler) on import

Hi

1. I am trying to install wxWidgets and wxPython on an SGI Altix,
IA64 server running SuSe Linux, SLES 10

2. I am installing from a source build (version wxPython-src-2.8.10.1)

3. I am using python V 2.6 (built from source)

4. All builds are with the GNU compilers

5. The prerequisites are all in place via system RPMs

6. I have built and installed wxWidgets in /usr/local/wx-2.8
    (following the BUILD.html instructions) with no special
    options

7. I have built and installed wxPython via the instructions
    in BUILD.html via

    - python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/
wx-2.8/bin/wx-config
    - python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
config

8. This locates the wx package in the python 2.6 tree as below:

# ls /usr/local/python-2.6/lib/python2.6/site-packages/
nifti numpy-1.4.0rc1-py2.6.egg-info
scipy-0.7.1-py2.6.egg-info wxversion.py
nose pynifti-0.20090303.1-py2.6.egg-info
wx-2.8-gtk2-unicode wxversion.pyc
nose-0.10.4-py2.6.egg-info README
wx.pth
numpy scipy
wxPython_common-2.8.10.1-py2.6.egg-info

The wx.path file correctly points at wx-2.8-gtk2-unicode which
contains:

# ls /usr/local/python-2.6/lib/python2.6/site-packages/wx-2.8-gtk2-
unicode/
wx wxPython wxPython-2.8.10.1-py2.6.egg-info

9. Trying to import the package:

Python 2.6.4 (r264:75706, Dec 23 2009, 14:55:37)
[GCC 4.1.2 20070115 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import wx

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named wx

10. Google suggests I must do (don't know why)

import wxversion
wxversion.select('2.8')
import wx

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/wx/_core.py", line 4, in <module>
    import _core_
ImportError: /usr/local/python-2.6.4/lib/python2.6/site-packages/
wx-2.8-gtk2-unicode/wx/_core_.so: undefined symbol:
_ZNK14wxImageHandler12GetClassInfoEv

which seems to be progress in that at least it find the package
although there is an unresolved symbol.

11. ldd on this library shows:

# ldd _core_.so
  linux-gate.so.1 => (0xa000000000000000)
  libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x2000000800404000)
  libm.so.6.1 => /lib/libm.so.6.1 (0x20000008005c4000)
  libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2000000800694000)
  libunwind.so.7 => /lib/libunwind.so.7 (0x20000008006b4000)
  libpthread.so.0 => /lib/libpthread.so.0 (0x2000000800700000)
  libc.so.6.1 => /lib/libc.so.6.1 (0x200000080073c000)
  /lib/ld-linux-ia64.so.2 (0x2000000800000000)

which are all system libraries.

12. I am just installing this for someone, I am not a user, so I am
not familiar
with where the ImageHandler symbol should be supplied.

any help appreciated

thanks
Neil

Still hoping someone has a suggestion on how to resolve this
symbol error...

thanks
Neil

···

On Jan 4, 3:15 pm, Neil <nkill...@unimelb.edu.au> wrote:

Hi

1. I am trying to install wxWidgets and wxPython on an SGI Altix,
IA64 server running SuSe Linux, SLES 10

2. I am installing from a source build (version wxPython-src-2.8.10.1)

3. I am using python V 2.6 (built from source)

4. All builds are with the GNU compilers

5. The prerequisites are all in place via system RPMs

6. I have built and installed wxWidgets in /usr/local/wx-2.8
(following the BUILD.html instructions) with no special
options

7. I have built and installed wxPython via the instructions
in BUILD.html via

\- python setup\.py build\_ext \-\-inplace \-\-debug WX\_CONFIG=/usr/local/

wx-2.8/bin/wx-config
- python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
config

8. This locates the wx package in the python 2.6 tree as below:

# ls /usr/local/python-2.6/lib/python2.6/site-packages/
nifti numpy-1.4.0rc1-py2.6.egg-info
scipy-0.7.1-py2.6.egg-info wxversion.py
nose pynifti-0.20090303.1-py2.6.egg-info
wx-2.8-gtk2-unicode wxversion.pyc
nose-0.10.4-py2.6.egg-info README
wx.pth
numpy scipy
wxPython_common-2.8.10.1-py2.6.egg-info

The wx.path file correctly points at wx-2.8-gtk2-unicode which
contains:

# ls /usr/local/python-2.6/lib/python2.6/site-packages/wx-2.8-gtk2-
unicode/
wx wxPython wxPython-2.8.10.1-py2.6.egg-info

9. Trying to import the package:

Python 2.6.4 (r264:75706, Dec 23 2009, 14:55:37)
[GCC 4.1.2 20070115 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.>>> import wx

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named wx

10. Google suggests I must do (don't know why)

>>> import wxversion
>>> wxversion.select('2.8')
>>> import wx

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/wx/__init__.py", line 45, in <module>
from wx._core import *
File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/wx/_core.py", line 4, in <module>
import _core_
ImportError: /usr/local/python-2.6.4/lib/python2.6/site-packages/
wx-2.8-gtk2-unicode/wx/_core_.so: undefined symbol:
_ZNK14wxImageHandler12GetClassInfoEv

which seems to be progress in that at least it find the package
although there is an unresolved symbol.

11. ldd on this library shows:

# ldd _core_.so
linux-gate.so.1 => (0xa000000000000000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x2000000800404000)
libm.so.6.1 => /lib/libm.so.6.1 (0x20000008005c4000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2000000800694000)
libunwind.so.7 => /lib/libunwind.so.7 (0x20000008006b4000)
libpthread.so.0 => /lib/libpthread.so.0 (0x2000000800700000)
libc.so.6.1 => /lib/libc.so.6.1 (0x200000080073c000)
/lib/ld-linux-ia64.so.2 (0x2000000800000000)

which are all system libraries.

12. I am just installing this for someone, I am not a user, so I am
not familiar
with where the ImageHandler symbol should be supplied.

any help appreciated

thanks
Neil

I am getting a very similar error with with wx-2.8-gtk2-unicode from the standard Ubuntu repository. This is without any special build. I posted this in a previous email to the group, but for completeness I repeat it below:

It seems there is a bigger problem. Once the wx.pth files are correct, or if I use wxversion to select version 2.8, Python can’t import wx. I get this error:

Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)

[GCC 4.4.1] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import wxversion

wxversion.select(‘2.8’)

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/init.py”, line 45, in

from wx._core import *

File “/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 4, in

import _core_

ImportError: /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/core.so: symbol _ZNK12wxWindowBase18WindowToClientSizeERK6wxSize, version WXU_2.8 not defined in file libwx_gtk2u_core-2.8.so.0 with link time reference

When I Google this error, I only find one relevant hit, which suggests that they fixed the problem by loading the package libwxgtk2.8-dev. I have libwxgtk2.8-0 loaded, but not the -dev version. If I select libwxgtk2.8-dev for installation from Synaptic it tells me that it is going to mark the 2.8 headers for installation. When I click the Mark button, I get this error:

libwxgtk2.8-dbg:

Depends: libwxbase2.8-dbg but it is not going to be installed

Depends: libwxgtk2.8-0 (=2.8.10.1-0ubuntu1) but 2.8.10.1-1 is to be installed

It looks to me like some sort of dependency hell. Any idea how to get around this problem so that wx version 2.8 will load? If it makes any difference, the specific 2.8 is wx-2.8-gtk2-unicode.

Thanks again,

Tom

···

On Tue, 2010-01-05 at 15:14 -0800, Neil wrote:


Still hoping someone has a suggestion on how to resolve this
symbol error...
thanks
Neil
On Jan 4, 3:15 pm, Neil <nkill...@unimelb.edu.au> wrote:
> Hi
>
> 1. I am trying to install wxWidgets and wxPython on an  SGI Altix,
> IA64 server running SuSe Linux, SLES 10
>
> 2. I am installing from a source build (version wxPython-src-2.8.10.1)
>
> 3. I am using python V 2.6 (built from source)
>
> 4. All builds are with the GNU compilers
>
> 5. The prerequisites are all in place via system RPMs
>
> 6. I have built and installed wxWidgets in /usr/local/wx-2.8
>     (following the BUILD.html instructions) with no special
>     options
>
> 7. I have built and installed wxPython via the instructions
>     in BUILD.html   via
>
>     - python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/
> wx-2.8/bin/wx-config
>     - python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
> config
>
> 8. This locates the wx package in the python 2.6 tree as below:
>
> # ls /usr/local/python-2.6/lib/python2.6/site-packages/
> nifti                       numpy-1.4.0rc1-py2.6.egg-info
> scipy-0.7.1-py2.6.egg-info               wxversion.py
> nose                        pynifti-0.20090303.1-py2.6.egg-info
> wx-2.8-gtk2-unicode                      wxversion.pyc
> nose-0.10.4-py2.6.egg-info  README
> wx.pth
> numpy                       scipy
> wxPython_common-2.8.10.1-py2.6.egg-info
>
> The wx.path file correctly points at wx-2.8-gtk2-unicode  which
> contains:
>
> # ls /usr/local/python-2.6/lib/python2.6/site-packages/wx-2.8-gtk2-
> unicode/
> wx  wxPython  wxPython-2.8.10.1-py2.6.egg-info
>
> 9.  Trying to import the package:
>
> Python 2.6.4 (r264:75706, Dec 23 2009, 14:55:37)
> [GCC 4.1.2 20070115 (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> import wx
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named wx
>
> 10.  Google suggests I must do (don't know why)
>
> >>> import wxversion
> >>> wxversion.select('2.8')
> >>> import wx
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
> gtk2-unicode/wx/__init__.py", line 45, in <module>
>     from wx._core import *
>   File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
> gtk2-unicode/wx/_core.py", line 4, in <module>
>     import _core_
> ImportError: /usr/local/python-2.6.4/lib/python2.6/site-packages/
> wx-2.8-gtk2-unicode/wx/_core_.so: undefined symbol:
> _ZNK14wxImageHandler12GetClassInfoEv
>
> which seems to be progress in that at least it find the package
> although there is an unresolved symbol.
>
> 11.  ldd on this library shows:
>
> #  ldd _core_.so
>         linux-gate.so.1 =>  (0xa000000000000000)
>         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x2000000800404000)
>         libm.so.6.1 => /lib/libm.so.6.1 (0x20000008005c4000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2000000800694000)
>         libunwind.so.7 => /lib/libunwind.so.7 (0x20000008006b4000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0x2000000800700000)
>         libc.so.6.1 => /lib/libc.so.6.1 (0x200000080073c000)
>         /lib/ld-linux-ia64.so.2 (0x2000000800000000)
>
> which are all system libraries.
>
> 12. I am just installing this for someone, I am not a user, so I am
> not familiar
> with where the ImageHandler symbol should be supplied.
>
> any help appreciated
>
> thanks
> Neil
-- To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)

You'll probably have to wait for Robin or one of the Linux gurus to
check their email. I have only installed wx on Ubuntu and I haven't
had any problems.

···

On Jan 5, 5:14 pm, Neil <nkill...@unimelb.edu.au> wrote:

Still hoping someone has a suggestion on how to resolve this
symbol error...

thanks
Neil

On Jan 4, 3:15 pm, Neil <nkill...@unimelb.edu.au> wrote:

> Hi

> 1. I am trying to install wxWidgets and wxPython on an SGI Altix,
> IA64 server running SuSe Linux, SLES 10

> 2. I am installing from a source build (version wxPython-src-2.8.10.1)

> 3. I am using python V 2.6 (built from source)

> 4. All builds are with the GNU compilers

> 5. The prerequisites are all in place via system RPMs

> 6. I have built and installed wxWidgets in /usr/local/wx-2.8
> (following the BUILD.html instructions) with no special
> options

> 7. I have built and installed wxPython via the instructions
> in BUILD.html via

> - python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/
> wx-2.8/bin/wx-config
> - python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
> config

> 8. This locates the wx package in the python 2.6 tree as below:

> # ls /usr/local/python-2.6/lib/python2.6/site-packages/
> nifti numpy-1.4.0rc1-py2.6.egg-info
> scipy-0.7.1-py2.6.egg-info wxversion.py
> nose pynifti-0.20090303.1-py2.6.egg-info
> wx-2.8-gtk2-unicode wxversion.pyc
> nose-0.10.4-py2.6.egg-info README
> wx.pth
> numpy scipy
> wxPython_common-2.8.10.1-py2.6.egg-info

> The wx.path file correctly points at wx-2.8-gtk2-unicode which
> contains:

> # ls /usr/local/python-2.6/lib/python2.6/site-packages/wx-2.8-gtk2-
> unicode/
> wx wxPython wxPython-2.8.10.1-py2.6.egg-info

> 9. Trying to import the package:

> Python 2.6.4 (r264:75706, Dec 23 2009, 14:55:37)
> [GCC 4.1.2 20070115 (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> import wx

> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named wx

> 10. Google suggests I must do (don't know why)

> >>> import wxversion
> >>> wxversion.select('2.8')
> >>> import wx

> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
> gtk2-unicode/wx/__init__.py", line 45, in <module>
> from wx._core import *
> File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
> gtk2-unicode/wx/_core.py", line 4, in <module>
> import _core_
> ImportError: /usr/local/python-2.6.4/lib/python2.6/site-packages/
> wx-2.8-gtk2-unicode/wx/_core_.so: undefined symbol:
> _ZNK14wxImageHandler12GetClassInfoEv

> which seems to be progress in that at least it find the package
> although there is an unresolved symbol.

> 11. ldd on this library shows:

> # ldd _core_.so
> linux-gate.so.1 => (0xa000000000000000)
> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x2000000800404000)
> libm.so.6.1 => /lib/libm.so.6.1 (0x20000008005c4000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2000000800694000)
> libunwind.so.7 => /lib/libunwind.so.7 (0x20000008006b4000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x2000000800700000)
> libc.so.6.1 => /lib/libc.so.6.1 (0x200000080073c000)
> /lib/ld-linux-ia64.so.2 (0x2000000800000000)

> which are all system libraries.

> 12. I am just installing this for someone, I am not a user, so I am
> not familiar
> with where the ImageHandler symbol should be supplied.

> any help appreciated

> thanks
> Neil

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21 http://us.pycon.org/

Okay, I got to the bottom of this (at least so far). I believe this relates to wxPython now being included in the Ubuntu repository. Prior to Ubuntu karmic, my wx packages were all from 2.8.10.1-1. The new versions are all 2.8.10.1-0ubuntu1. Trying to reinstall any related package created a dependency hell situation where Synaptic wanted to use 2.8.10.1-1, but the new package required 2.8.10.1-0ubuntu1.

To fix this, I had to first remove all of the old packages, then reinstall them. When I tried to do it piece by piece to test individual packages, it Synaptic had the dependency problem. Once they were all removed, Synaptic recognized the new dependencies and properly installed the new packages.

Everything loads okay now. Now I need to test the code and make sure it works.

Tom

···

On Tue, 2010-01-05 at 21:19 -0500, Thomas M Wetherbee wrote:

I am getting a very similar error with with wx-2.8-gtk2-unicode from the standard Ubuntu repository. This is without any special build. I posted this in a previous email to the group, but for completeness I repeat it below:

It seems there is a bigger problem. Once the wx.pth files are correct, or if I use wxversion to select version 2.8, Python can't import wx. I get this error:



Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)

[GCC 4.4.1] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import wxversion

>>> wxversion.select('2.8')

>>> import wx

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/__init__.py", line 45, in <module>

    from wx._core import *

  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 4, in <module>

    import _core_

ImportError: /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so: symbol _ZNK12wxWindowBase18WindowToClientSizeERK6wxSize, version WXU_2.8 not defined in file libwx_gtk2u_core-2.8.so.0 with link time reference



When I Google this error, I only find one relevant hit, which suggests that they fixed the problem by loading the package libwxgtk2.8-dev. I have libwxgtk2.8-0 loaded, but not the -dev version. If I select libwxgtk2.8-dev for installation from Synaptic it tells me that it is going to mark the 2.8 headers for installation. When I click the Mark button, I get this error:



libwxgtk2.8-dbg:

Depends: libwxbase2.8-dbg but it is not going to be installed

  Depends: libwxgtk2.8-0 (=2.8.10.1-0ubuntu1) but 2.8.10.1-1 is to be installed



It looks to me like some sort of dependency hell. Any idea how to get around this problem so that wx version 2.8 will load? If it makes any difference, the specific 2.8 is wx-2.8-gtk2-unicode.



Thanks again,

Tom



On Tue, 2010-01-05 at 15:14 -0800, Neil wrote:

Still hoping someone has a suggestion on how to resolve this
symbol error...
thanks
Neil
On Jan 4, 3:15 pm, Neil <nkill...@unimelb.edu.au> wrote:
> Hi
>
> 1. I am trying to install wxWidgets and wxPython on an  SGI Altix,
> IA64 server running SuSe Linux, SLES 10
>
> 2. I am installing from a source build (version wxPython-src-2.8.10.1)
>
> 3. I am using python V 2.6 (built from source)
>
> 4. All builds are with the GNU compilers
>
> 5. The prerequisites are all in place via system RPMs
>
> 6. I have built and installed wxWidgets in /usr/local/wx-2.8
>     (following the BUILD.html instructions) with no special
>     options
>
> 7. I have built and installed wxPython via the instructions
>     in BUILD.html   via
>
>     - python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/
> wx-2.8/bin/wx-config
>     - python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
> config
>
> 8. This locates the wx package in the python 2.6 tree as below:
>
> # ls /usr/local/python-2.6/lib/python2.6/site-packages/
> nifti                       numpy-1.4.0rc1-py2.6.egg-info
> scipy-0.7.1-py2.6.egg-info               wxversion.py
> nose                        pynifti-0.20090303.1-py2.6.egg-info
> wx-2.8-gtk2-unicode                      wxversion.pyc
> nose-0.10.4-py2.6.egg-info  README
> wx.pth
> numpy                       scipy
> wxPython_common-2.8.10.1-py2.6.egg-info
>
> The wx.path file correctly points at wx-2.8-gtk2-unicode  which
> contains:
>
> # ls /usr/local/python-2.6/lib/python2.6/site-packages/wx-2.8-gtk2-
> unicode/
> wx  wxPython  wxPython-2.8.10.1-py2.6.egg-info
>
> 9.  Trying to import the package:
>
> Python 2.6.4 (r264:75706, Dec 23 2009, 14:55:37)
> [GCC 4.1.2 20070115 (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> import wx
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named wx
>
> 10.  Google suggests I must do (don't know why)
>
> >>> import wxversion
> >>> wxversion.select('2.8')
> >>> import wx
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
> gtk2-unicode/wx/__init__.py", line 45, in <module>
>     from wx._core import *
>   File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
> gtk2-unicode/wx/_core.py", line 4, in <module>
>     import _core_
> ImportError: /usr/local/python-2.6.4/lib/python2.6/site-packages/
> wx-2.8-gtk2-unicode/wx/_core_.so: undefined symbol:
> _ZNK14wxImageHandler12GetClassInfoEv
>
> which seems to be progress in that at least it find the package
> although there is an unresolved symbol.
>
> 11.  ldd on this library shows:
>
> #  ldd _core_.so
>         linux-gate.so.1 =>  (0xa000000000000000)
>         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x2000000800404000)
>         libm.so.6.1 => /lib/libm.so.6.1 (0x20000008005c4000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2000000800694000)
>         libunwind.so.7 => /lib/libunwind.so.7 (0x20000008006b4000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0x2000000800700000)
>         libc.so.6.1 => /lib/libc.so.6.1 (0x200000080073c000)
>         /lib/ld-linux-ia64.so.2 (0x2000000800000000)
>
> which are all system libraries.
>
> 12. I am just installing this for someone, I am not a user, so I am
> not familiar
> with where the ImageHandler symbol should be supplied.
>
> any help appreciated
>
> thanks
> Neil
-- To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
-- To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)

I wondered if it might be due to a mixture of packages. Thanks for following up on this.

···

On 1/6/10 7:08 AM, Thomas M Wetherbee wrote:

Okay, I got to the bottom of this (at least so far). I believe this
relates to wxPython now being included in the Ubuntu repository. Prior
to Ubuntu karmic, my wx packages were all from 2.8.10.1-1. The new
versions are all 2.8.10.1-0ubuntu1. Trying to reinstall any related
package created a dependency hell situation where Synaptic wanted to use
2.8.10.1-1, but the new package required 2.8.10.1-0ubuntu1.

To fix this, I had to first remove all of the old packages, then
reinstall them. When I tried to do it piece by piece to test individual
packages, it Synaptic had the dependency problem. Once they were all
removed, Synaptic recognized the new dependencies and properly installed
the new packages.

--
Robin Dunn
Software Craftsman

7. I have built and installed wxPython via the instructions
     in BUILD.html via

     - python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/
wx-2.8/bin/wx-config
     - python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
config

8. This locates the wx package in the python 2.6 tree as below:

# ls /usr/local/python-2.6/lib/python2.6/site-packages/

Looking at the path names in the traceback, this is *not* the instance of wxPython that you actually used.

Traceback (most recent call last):
   File "<stdin>", line 1, in<module>
   File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/wx/__init__.py",

Notice the extra ".4" in there?

You may want to clean out those two instances of wxPython and then redo at least the wxPython part of the build. Make sure that the Python binary you use to run setup.py is the same one that you use when running the application.

···

On 1/5/10 3:14 PM, Neil wrote:

--
Robin Dunn
Software Craftsman

Hi Robin

1. it's just a symlink:

lrwxrwxrwx 1 root root 13 2009-12-23 15:03 python-2.6 ->
python-2.6.4/
drwxr-xr-x 7 root root 62 2009-12-23 15:22 python-2.6.4

so this is not the problem; but well spotted ! wxPython
wxPython *is* a part of the SUSE SLES 10 distribution, but only for
python 2.4
and those RPMs are not installed. I am working with python 2.6 which
i installled
from source and access via a module file.

2. Anyway, I redid the entire installation, wxWidgets and wxPython.
I removed all of
the installed directories first and re-did it.

This time, I got different behaviour:

import wxversion
wxversion.select('2.8')
import wx

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
gtk2-unicode/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

Setting LD_LIBRARY_PATH to include /usr/local/wx-2.8/lib

resolved this and wx imported successfully and i was able to follow
some test code
to see it run ok (some alignment error messages that don't appear
fatal).

The only reason I can think of why the beahviour is different is
perhaps I forgot the --enable-unicode configure switch when I build
wxWidgets (its not in my wiki notes....); wxPython expects unicode
enabled
wxWidgets.

3. So I seem to be functional (or at least wxPython is)

4. Finally, can someone explain why I need to do the import wxversion;
wxversion.select('2.8')
thing and is it correct that I have to explicitly set
LD_LIBRARY_PATH ? I would have
thought because I explicittly specified where wxWidgets is in the
build that would pass
through to the python import.

cheers
Neil

···

On Jan 7, 6:09 am, Robin Dunn <ro...@alldunn.com> wrote:

On 1/5/10 3:14 PM, Neil wrote:

>> 7. I have built and installed wxPython via the instructions
>> in BUILD.html via

>> - python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/
>> wx-2.8/bin/wx-config
>> - python setup.py install WX_CONFIG=/usr/local/wx-2.8/bin/wx-
>> config

>> 8. This locates the wx package in the python 2.6 tree as below:

>> # ls /usr/local/python-2.6/lib/python2.6/site-packages/

Looking at the path names in the traceback, this is *not* the instance
of wxPython that you actually used.

>> Traceback (most recent call last):
>> File "<stdin>", line 1, in<module>
>> File "/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-
>> gtk2-unicode/wx/__init__.py",

Notice the extra ".4" in there?

You may want to clean out those two instances of wxPython and then redo
at least the wxPython part of the build. Make sure that the Python
binary you use to run setup.py is the same one that you use when running
the application.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

It should. The wx.pth file should be causing the parent folder of the wx package to be added to the sys.path, enabling a "import wx" to find it. (wxversion.select does essentially the same thing, but allows a specific instance to be added to the path if there is more than one.)

Try looking at the default contents of the sys.path list and compare it to the contents of the wx.pth file. Maybe something is preventing wx.pth from being processed by the Python startup code, or maybe there is a typo somewhere.

···

On 1/6/10 4:33 PM, Neil wrote:

4. Finally, can someone explain why I need to do the import wxversion;
wxversion.select('2.8')
thing and is it correct that I have to explicitly set
LD_LIBRARY_PATH ? I would have
thought because I explicittly specified where wxWidgets is in the
build that would pass
through to the python import.

--
Robin Dunn
Software Craftsman

import sys
sys.path

['/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-gtk2-
unicode', '', '/usr/local/python-2.6.4/lib/python26.zip', '/usr/local/
python-2.6.4/lib/python2.6', '/usr/local/python-2.6.4/lib/python2.6/
plat-linux2', '/usr/local/python-2.6.4/lib/python2.6/lib-tk', '/usr/
local/python-2.6.4/lib/python2.6/lib-old', '/usr/local/python-2.6.4/
lib/python2.6/lib-dynload', '/usr/local/python-2.6.4/lib/python2.6/
site-packages']

and

% cd /usr/local/python-2.6/lib/python2.6/site-packages
% more wx.pth
wx-2.8-gtk2-unicode

but there is nothing in there about where wxWidgets is (/usr/local/
wx-2.8).

cheers
Neil

···

On Jan 7, 12:18 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 1/6/10 4:33 PM, Neil wrote:

> 4. Finally, can someone explain why I need to do the import wxversion;
> wxversion.select('2.8')
> thing and is it correct that I have to explicitly set
> LD_LIBRARY_PATH ? I would have
> thought because I explicittly specified where wxWidgets is in the
> build that would pass
> through to the python import.

It should. The wx.pth file should be causing the parent folder of the
wx package to be added to the sys.path, enabling a "import wx" to find
it. (wxversion.select does essentially the same thing, but allows a
specific instance to be added to the path if there is more than one.)

Try looking at the default contents of the sys.path list and compare it
to the contents of the wx.pth file. Maybe something is preventing
wx.pth from being processed by the Python startup code, or maybe there
is a typo somewhere.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

import sys
sys.path

['/usr/local/python-2.6.4/lib/python2.6/site-packages/wx-2.8-gtk2-
unicode',

Well it's there. Python should be able to automatically find the wx package dir located there without needing wxversion.select to do any more path manipulation.

'', '/usr/local/python-2.6.4/lib/python26.zip', '/usr/local/
python-2.6.4/lib/python2.6', '/usr/local/python-2.6.4/lib/python2.6/
plat-linux2', '/usr/local/python-2.6.4/lib/python2.6/lib-tk', '/usr/
local/python-2.6.4/lib/python2.6/lib-old', '/usr/local/python-2.6.4/
lib/python2.6/lib-dynload', '/usr/local/python-2.6.4/lib/python2.6/
site-packages']

and

% cd /usr/local/python-2.6/lib/python2.6/site-packages
% more wx.pth
wx-2.8-gtk2-unicode

but there is nothing in there about where wxWidgets is (/usr/local/
wx-2.8).

The Python sys.path doesn't care about that when trying to locate the packages/modules. That folder does, however, need to be on the LD_LIBRARY_PATH (or equivalent) so the dynamic loader can find the shared libraries when the wxPython extension modules are loaded by Python.

···

On 1/6/10 6:51 PM, Neil wrote:

--
Robin Dunn
Software Craftsman