glcanvas import error

hello,
I have tested below example.
http://code.activestate.com/recipes/325392-use-wxpythonopengl-to-draw-a-sphere/

but I got this error on wxPython2.9.3.1 version
Traceback (most recent call last):
  File "/usr/local/src/eclipse_1.4/plugins/
org.python.pydev.debug_2.3.0.2011121518/pysrc/pydevd.py", line 1307,
in <module>
    debugger.run(setup['file'], None, None)
  File "/usr/local/src/eclipse_1.4/plugins/
org.python.pydev.debug_2.3.0.2011121518/pysrc/pydevd.py", line 1060,
in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "/home/choiwonjun/workspace/wxPython/PENOLA_20120106/test/
wx_example/test6.py", line 7, in <module>
    from wx import *
  File "/usr/local/lib/python2.7/dist-packages/wx-2.9.3-gtk2/wx/
glcanvas.py", line 8, in <module>
    import _glcanvas
ImportError: /usr/local/lib/python2.7/dist-packages/wx-2.9.3-gtk2/wx/
_glcanvas.so: undefined symbol: _ZTI14wxEventFunctor

after I switch like this:

WXVER = '2.9'
import wxversion
wxversion.select(WXVER)

import wx

from wx import *
from wx.glcanvas import wxGLCanvas
from wxPython.wx import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
import sys,math

Wonjun, Choi

does anyone know how to run this demo?

A general comment for you that may, or may not, have a bearing on your
problem, the above is VERY bad practice, in general you should try to
avoid the from package import * and are asking for problems if you use
it more than once in any given module, this is because you are avoiding
using namespaces which means that if the various packages that you are
importing everything from without the package name qualifier have
objects or methods with the same names then the last one imported will
take the place of the other(s). If you find that you are having to do
too much typing then you are better off using the import package as
shortname syntax so that all of your imported classes and methods are
name qualified. The double import of wx both as name qualified and as
an unqualified is especially horrible and probably nearly doubles your
start-up time.

It makes for much more readable code and less error prone code to always
use external packages from within a namespace.

Gadget/Steve

···

On 13/01/2012 8:45 AM, Wonjun, Choi wrote:

import wx

from wx import *
from wx.glcanvas import wxGLCanvas
from wxPython.wx import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
import sys,math

Wonjun, Choi

That demo is very old, and it uses mixed spaces and tabs for indentation... instead of fixing it I salvaged the relevant OpenGL parts and used them with my glutton library.

I have attached the result and you can get glutton from https://bitbucket.org/raz/glutton

sphere.py (961 Bytes)

···

On Mon, 16 Jan 2012 09:13:50 +0100, 최원준 <wonjunchoi001@gmail.com> wrote:

does anyone know how to run this demo?

Things like this usually mean that the wx that was used at compile time (C++ headers and libraries) is not the same one being used (via the dynamic linker) at run time.

···

On 1/13/12 12:45 AM, Wonjun, Choi wrote:

     import _glcanvas
ImportError: /usr/local/lib/python2.7/dist-packages/wx-2.9.3-gtk2/wx/
_glcanvas.so: undefined symbol: _ZTI14wxEventFunctor

--
Robin Dunn
Software Craftsman

there is also error though I use glutton module.

File “/home/workspace/wxPython/test/sphere.py”, line 7, in
from glutton import canvas, presets
File “/home/workspace/wxPython/test/glutton/canvas.py”, line 32, in
import wx.glcanvas
File “/usr/local/lib/python2.7/dist-packages/wx/glcanvas.py”, line 8, in
import _glcanvas
ImportError: /usr/local/lib/python2.7/dist-packages/wx/_glcanvas.so: undefined symbol: _ZTI14wxEventFunctor

glutton uses glcanvas, so you get the same error as before when you failed to import it.

Am I right to assume that you are trying to use wx binaries you compiled yourself? If so you probably didn't do something right there, or as Robin suggested you have some other wx binaries that are somehow getting in the way.

···

On Tue, 17 Jan 2012 00:57:12 +0100, 최원준 <wonjunchoi001@gmail.com> wrote:

there is also error though I use glutton module.

  File "/home/workspace/wxPython/test/sphere.py", line 7, in <module>
    from glutton import canvas, presets
  File "/home/workspace/wxPython/test/glutton/canvas.py", line 32, in
<module>
    import wx.glcanvas
  File "/usr/local/lib/python2.7/dist-packages/wx/glcanvas.py", line 8, in
<module>
    import _glcanvas
ImportError: /usr/local/lib/python2.7/dist-packages/wx/_glcanvas.so:
undefined symbol: _ZTI14wxEventFunctor

I am trying to use opengl in wxPython. so I found some example from above website and I got the error.

Hey! -- This looks very cool. Do you have a written description of it
anywhere? intent, use case examples, etc? At a glance, it kind of
looks like an OpenGL version of FloatCanvas -- which would be very
nice.

-Chris

···

On Mon, Jan 16, 2012 at 12:55 AM, Toni Ruža <gmr.gaf@gmail.com> wrote:

you can get glutton from
https://bitbucket.org/raz/glutton

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

you can get glutton from
https://bitbucket.org/raz/glutton

Hey! -- This looks very cool.

Thanks, I'm glad you like it.

Do you have a written description of it
anywhere? intent, use case examples, etc? At a glance, it kind of
looks like an OpenGL version of FloatCanvas -- which would be very
nice.

It was recently born out of my refactoring a mapping application I am making for a client and a desire to test out a particular initialization method idea (see how the Canvas mixins are initialized if you are interested).

It is usable as it is for it's basic purpose but many of the things I imagined for it are still missing. The most important of which are classes for managing the contents of a vbo, interruptible rendering, efficient ttf glyph renderer, tiled raster backgrounds, classes for basic shapes and a layered 2d scene graph. And of course, if it were to compete with FloatCanvas some coordinate system transformation code should be in there too.

There is no documentation yet, only the few use case examples (the test_* files). If you feel like playing with it I would be glad to answer questions and discuss the implementation.

Toni

···

On Wed, 18 Jan 2012 00:14:16 +0100, Chris Barker <chris.barker@noaa.gov> wrote:

On Mon, Jan 16, 2012 at 12:55 AM, Toni Ruža <gmr.gaf@gmail.com> wrote:

I got this error any idea about this?

import wxeventbinder
ImportError: No module named wxeventbinder

It's included in the glutton repository or you can get it from https://bitbucket.org/raz/wxeventbinder

···

On Thu, 19 Jan 2012 02:19:33 +0100, 최원준 <wonjunchoi001@gmail.com> wrote:

I got this error any idea about this?

import wxeventbinder
ImportError: No module named wxeventbinder

can I run this in wx2.9 version? I could run this in wx2.8 version but wx2.9.

2.9 was used to make it. It should also work with 2.8 but I didn't test it.

···

On Thu, 19 Jan 2012 09:00:56 +0100, 최원준 <wonjunchoi001@gmail.com> wrote:

can I run this in wx2.9 version? I could run this in wx2.8 version but
wx2.9.

I got this error in 2.9

import _glcanvas

ImportError: /usr/local/lib/python2.7/dist-packages/wx-2.9.3-gtk2/wx/_glcanvas.so: undefined symbol: _ZTI14wxEventFunctor

최원준 wrote:

I got this error in 2.9

      import _glcanvas

  ImportError:

/usr/local/lib/python2.7/dist-packages/wx-2.9.3-gtk2/wx/_glcanvas.so:
undefined symbol: _ZTI14wxEventFunctor

I notice this is in /usr/local/lib.  Is it possible you have

multiple Python installations on your disk, and they are getting
confused?

That name is the typinfo entry for wxEventFunctor, and is present in

libwx_baseu-2.9.so. Why don’t you double-check that all of the
libwx files are present where you expect?

···
-- Tim Roberts, Providenza & Boekelheide, Inc.

timr@probo.com

you can get glutton from
https://bitbucket.org/raz/glutton

Thanks, I'm glad you like it.

It was recently born out of my refactoring a mapping application I am making
for a client and a desire to test out a particular initialization method
idea (see how the Canvas mixins are initialized if you are interested).

Mapping? you're kidding! We're working on a wxPython/ PyOpenGL based
mapping lib/application as well -- we really should talk. It's in a
bit of a mess now, but here is an older version:

https://bitbucket.org/dhelfman/maproom/wiki/Home

It is usable as it is for it's basic purpose but many of the things I
imagined for it are still missing. The most important of which are classes
for managing the contents of a vbo, interruptible rendering, efficient ttf
glyph renderer, tiled raster backgrounds, classes for basic shapes and a
layered 2d scene graph.

All nice stuff to have, of course!

And of course, if it were to compete with
FloatCanvas some coordinate system transformation code should be in there
too.

There is nothing now? How do you do mapping without any coordinate
transformation?

Anyway, the stuff is FloatCanvas is a bit too limited anyway. In
MapRoom, we are using pyproj for full map projection suport, and
GDAL/OGR for geo-spatial data set support.

We do have a tiled mapp implementation there, though it only points to
tiles that are self-generated so far.

There is no documentation yet, only the few use case examples (the test_*
files). If you feel like playing with it I would be glad to answer questions
and discuss the implementation.

I'll try to take a look, yes. There could be a great opportunity for
collaboration here.

-Chris

···

On Tue, Jan 17, 2012 at 10:54 PM, Toni Ruža <gmr.gaf@gmail.com> wrote:

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Mapping? you're kidding! We're working on a wxPython/ PyOpenGL based
mapping lib/application as well -- we really should talk. It's in a
bit of a mess now, but here is an older version:

https://bitbucket.org/dhelfman/maproom/wiki/Home

As it happens I just stumbled on to this recently and glanced at what it does and how it does it.

Didn't make it run though, just browsed the code a bit and made a mental note to come back to it someday.

It is usable as it is for it's basic purpose but many of the things I
imagined for it are still missing. The most important of which are classes
for managing the contents of a vbo, interruptible rendering, efficient ttf
glyph renderer, tiled raster backgrounds, classes for basic shapes and a
layered 2d scene graph.

All nice stuff to have, of course!

And of course, if it were to compete with
FloatCanvas some coordinate system transformation code should be in there
too.

There is nothing now? How do you do mapping without any coordinate
transformation?

It's for land surveyors, the areas are small and they work in a state mandated Cartesian-like system. I'm just offsetting coordinates to avoid huge numbers that would mess with OpenGL's 32 bit float accuracy. Coordinates they use look like this:

D150 7466823.174 4958088.962 -2.371
D151 7466826.289 4958085.884 -2.230
D152 7466828.345 4958084.652 -2.111

Units are in meters and the first few digits of x and y have some special meaning about the placement of the coordinate system on the earth.

Anyway, the stuff is FloatCanvas is a bit too limited anyway. In
MapRoom, we are using pyproj for full map projection suport, and
GDAL/OGR for geo-spatial data set support.

Just found out about pyproj recently, I will almost certainly want to use it too.

We do have a tiled mapp implementation there, though it only points to
tiles that are self-generated so far.

There is no documentation yet, only the few use case examples (the test_*
files). If you feel like playing with it I would be glad to answer questions
and discuss the implementation.

I'll try to take a look, yes. There could be a great opportunity for
collaboration here.

The projects are similar yet it seems we focused on different areas. The things I focused on are largely connected to making nice COGO automations and UI, easy print layout and dynamically generating the shape geometry based on the scale of the map, shape attributes and a topographic key.

It's a bit of a one-man-army situation here and I wouldn't mind collaboration at all... :slight_smile:

Hopefully we can merge our efforts into something that is closer to the ambitious end result.

Toni

···

On Thu, 19 Jan 2012 21:20:56 +0100, Chris Barker <chris.barker@noaa.gov> wrote:

I notice this is in /usr/local/lib. Is it possible you have
multiple Python installations on your disk, and they are getting
confused?

>That name is the typinfo entry for wxEventFunctor, and is present in

libwx_baseu-2.9.so . Why don’t you double-check that all of the
libwx files >are present where you expect?

/usr/local/lib/libwx_baseu-2.9.so
/usr/local/lib/libwx_baseu-2.9.so.2
/usr/local/lib/libwx_baseu-2.9.so.2.0.0
/usr/local/lib/libwx_baseu-2.9.so.3
/usr/local/lib/libwx_baseu-2.9.so.3.0.0

/usr/local/lib/python3.2
/usr/lib/python2.7

I can switch python version by #!/usr/bin/env python3 or 2