WxPython upgrade trouble on Ubuntu 8.04

Hello everyone,

You know the old saying, "in for a penny, in for a pound."

Yesterday I posted this...

http://groups.google.com/group/comp.lang.python/msg/0a86e792c674adc8

...in which I described my desire to acquire Python 2.6 without
upgrading my Ubuntu Linux installation from 8.04.

Since Python 2.6 is not part of the Ubuntu 8.04 repository, I
installed Python 2.6 manually. Things are a little messy right now,
since invoking IDLE from the desktop still defaults to Python 2.5.
But I'm getting there. At least I can access Python 2.6 from the
command prompt, and SCIte also finds 2.6.

Of course, I also have to reinstall all of the Python modules that I
use on 2.6. I have succeeded with numpy and biopython, both installed
manually. WxPython is giving me trouble, though.

I visited wxpython.org and noted that wx version 2.8.10.1 fixes some
important bugs that can occur when using Python 2.6. The instructions
here...

http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

...allowed me to add the wxWidgets apt repository to the list of web
sites that my Synaptic Package Manager checks for updates. It found
wx 2.8.10.1 and auto-installed it. I got error messages from Python
2.5 until I also installed python-wxtools, wx2.8-i18n, libwxgtk2.8-
dev, and libgtk2.0-dev as recommended on the web page mentioned
above. Now "import wx" worked again, with no error messages, from
Python 2.5.

Installing wx on Python 2.6 is my ultimate goal, and that's where I
got stuck. I actually tried "import wx" from Python 2.6 first, and I
got this result:

import wx

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "wx/_core.py", line 4, in <module>
    import _core_
ImportError: No module named _core_

I went back to Synaptic, said that I wanted to reinstall wx 2.8.10.1
-- but not really, as I then selected "download package files only."
I received the tarball. The top-level folder has the wxWidgets C
code, which I believe is already installed. I selected the wxPython
directory at the second level. Tried "python setup.py build", and
after several minutes and dozens of warning messages, I finally got
this fatal error:

In file included from /usr/include/wx-2.8/wx/glcanvas.h:54,
                 from contrib/glcanvas/gtk/glcanvas_wrap.cpp:2661:
/usr/include/wx-2.8/wx/gtk/glcanvas.h: At global scope:
/usr/include/wx-2.8/wx/gtk/glcanvas.h:47: error: ‘GLXContext’ does not
name a type
/usr/include/wx-2.8/wx/gtk/glcanvas.h:124: error: ISO C++ forbids
declaration of ‘GLXFBConfig’ with no type
/usr/include/wx-2.8/wx/gtk/glcanvas.h:124: error: expected ‘;’ before
‘*’ token
error: command 'gcc' failed with exit status 1

Worse -- NOW if I start Python 2.5, I get the same error message I got
from 2.6.

I may yet bite the bullet and upgrade my Linux distro, though I've
read that Ubuntu 9.x has some problems...

Any advice? Many thanks!

Not sure but it seems it installed wxPython for Python2.5. Why not
uninstall Python 2.5?
I find troublesome to have two Python installation unless I use one
Editor that allows me to choose.

···

On Jan 25, 7:19 pm, John Ladasky <lada...@my-deja.com> wrote:

Hello everyone,

You know the old saying, "in for a penny, in for a pound."

Yesterday I posted this...

http://groups.google.com/group/comp.lang.python/msg/0a86e792c674adc8

...in which I described my desire to acquire Python 2.6 without
upgrading my Ubuntu Linux installation from 8.04.

Since Python 2.6 is not part of the Ubuntu 8.04 repository, I
installed Python 2.6 manually. Things are a little messy right now,
since invoking IDLE from the desktop still defaults to Python 2.5.
But I'm getting there. At least I can access Python 2.6 from the
command prompt, and SCIte also finds 2.6.

Of course, I also have to reinstall all of the Python modules that I
use on 2.6. I have succeeded with numpy and biopython, both installed
manually. WxPython is giving me trouble, though.

I visited wxpython.org and noted that wx version 2.8.10.1 fixes some
important bugs that can occur when using Python 2.6. The instructions
here...

InstallingOnUbuntuOrDebian - wxPyWiki

...allowed me to add the wxWidgets apt repository to the list of web
sites that my Synaptic Package Manager checks for updates. It found
wx 2.8.10.1 and auto-installed it. I got error messages from Python
2.5 until I also installed python-wxtools, wx2.8-i18n, libwxgtk2.8-
dev, and libgtk2.0-dev as recommended on the web page mentioned
above. Now "import wx" worked again, with no error messages, from
Python 2.5.

Installing wx on Python 2.6 is my ultimate goal, and that's where I
got stuck. I actually tried "import wx" from Python 2.6 first, and I
got this result:

>>> import wx

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wx/__init__.py", line 45, in <module>
from wx._core import *
File "wx/_core.py", line 4, in <module>
import _core_
ImportError: No module named _core_

I went back to Synaptic, said that I wanted to reinstall wx 2.8.10.1
-- but not really, as I then selected "download package files only."
I received the tarball. The top-level folder has the wxWidgets C
code, which I believe is already installed. I selected the wxPython
directory at the second level. Tried "python setup.py build", and
after several minutes and dozens of warning messages, I finally got
this fatal error:

In file included from /usr/include/wx-2.8/wx/glcanvas.h:54,
from contrib/glcanvas/gtk/glcanvas_wrap.cpp:2661:
/usr/include/wx-2.8/wx/gtk/glcanvas.h: At global scope:
/usr/include/wx-2.8/wx/gtk/glcanvas.h:47: error: ‘GLXContext’ does not
name a type
/usr/include/wx-2.8/wx/gtk/glcanvas.h:124: error: ISO C++ forbids
declaration of ‘GLXFBConfig’ with no type
/usr/include/wx-2.8/wx/gtk/glcanvas.h:124: error: expected ‘;’ before
‘*’ token
error: command 'gcc' failed with exit status 1

Worse -- NOW if I start Python 2.5, I get the same error message I got
from 2.6.

I may yet bite the bullet and upgrade my Linux distro, though I've
read that Ubuntu 9.x has some problems...

Any advice? Many thanks!

Steve, thanks for getting back to me... but for some reason my
original post took over 24 hours to appear on wxPython-users.

In the intervening silence, I bit the bullet and upgraded my OS to
Ubuntu 9.10. It broke my home network's file and print sharing. This
happens every time I upgrade. Blah.

HOWEVER, Python and wxPython are now working again. That being said,
the layout of my wx application window is wonky now! I will start
another thread to address that problem.

Users who have never posted to the list (at least since the switch to google groups) are moderated the first time they do, in order to cut down on spam.

···

On 1/29/10 4:50 PM, John Ladasky wrote:

Steve, thanks for getting back to me... but for some reason my
original post took over 24 hours to appear on wxPython-users.

--
Robin Dunn
Software Craftsman