From: ladasky on
Hello everyone,

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

Several hours ago 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 here's where I'm
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 wx binary stuff,
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.

Now I'm stuck again. Any advice? Many thanks!
From: Mike Driscoll on
On Jan 25, 5:18 am, "lada...(a)my-deja.com" <lada...(a)my-deja.com> wrote:
> Hello everyone,
>
> You know the old saying, "in for a penny, in for a pound."
>
> Several hours ago 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 here's where I'm
> 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 wx binary stuff,
> 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.
>
> Now I'm stuck again.  Any advice?  Many thanks!

Try re-posting to the wxPython mailing list. Someone there will know
what the next step is.

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

Blog: http://blog.pythonlibrary.org

PyCon 2010 Atlanta Feb 19-21 http://us.pycon.org/
From: John Ladasky on
Hi Mike,

Thanks, I forgot that wxPython-users is distinct from comp.soft-
sys.wxwindows. I'll give it a try.