A problem running the demos

7345 views
Skip to first unread message

Adam Faulconbridge

unread,
Sep 20, 2011, 8:09:20 AM9/20/11
to glumpy...@googlegroups.com
I am trying to run the demos on Ubuntu 10.10 64-bit.

I get errors similar to:

Traceback (most recent call last):
  File "simple.py", line 34, in <module>
    fig = glumpy.figure( (512,512) )
  File "/usr/local/lib/python2.6/dist-packages/glumpy-0.2.0-py2.6.egg/glumpy/__init__.py", line 68, in figure
    return Figure(size=size, position=position, parent=None)
  File "/usr/local/lib/python2.6/dist-packages/glumpy-0.2.0-py2.6.egg/glumpy/figure.py", line 93, in __init__
    self._window = Window( size, position, 'Figure')
  File "/usr/local/lib/python2.6/dist-packages/glumpy-0.2.0-py2.6.egg/glumpy/window/backend_glut.py", line 85, in __init__
    if glut.glutGetWindow( ) == 0:
  File "/usr/local/lib/python2.6/dist-packages/PyOpenGL-3.0.2a1-py2.6.egg/OpenGL/platform/baseplatform.py", line 377, in __call__
    self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutGetWindow, check for bool(glutGetWindow) before calling

I guess this is a missing library on my part. Ive installed glumpy, PyOpenGL, scipy, numpy, ipython and matplotlib all via easy_install. Anything else I should grab?

Nicolas Rougier

unread,
Sep 20, 2011, 8:50:45 AM9/20/11
to glumpy-users

Could you open a ticket on http://code.google.com/p/glumpy/issues/list
?

Nicolas


On Sep 20, 2:09 pm, Adam Faulconbridge <afaulconbri...@googlemail.com>
wrote:
> I am trying to run the demos on Ubuntu 10.10 64-bit.
>
> I get errors similar to:
>
> Traceback (most recent call last):
>   File "simple.py", line 34, in <module>
>     fig = glumpy.figure( (512,512) )
>   File
> "/usr/local/lib/python2.6/dist-packages/glumpy-0.2.0-py2.6.egg/glumpy/__ini t__.py",
> line 68, in figure
>     return Figure(size=size, position=position, parent=None)
>   File
> "/usr/local/lib/python2.6/dist-packages/glumpy-0.2.0-py2.6.egg/glumpy/figur e.py",
> line 93, in __init__
>     self._window = Window( size, position, 'Figure')
>   File
> "/usr/local/lib/python2.6/dist-packages/glumpy-0.2.0-py2.6.egg/glumpy/windo w/backend_glut.py",
> line 85, in __init__
>     if glut.glutGetWindow( ) == 0:
>   File
> "/usr/local/lib/python2.6/dist-packages/PyOpenGL-3.0.2a1-py2.6.egg/OpenGL/p latform/baseplatform.py",

Ricardo Henriques

unread,
Sep 20, 2011, 9:03:52 AM9/20/11
to glumpy...@googlegroups.com
Hi Adam,

I think you may be missing freeglut. Perhaps you could install pyopengl from apt first and then do a easy_install -U pyopengl to make sure you have the latest version.

Cheers,
R

Ricardo Henriques
Instituto de Medicina Molecular (Lisbon, Portugal).
For contact information see: https://sites.google.com/site/paxcalpt/

Devendra Singh Sachan

unread,
Jun 21, 2012, 3:27:15 PM6/21/12
to glumpy...@googlegroups.com
I am running the following program 

fig = glumpy.figure( (512,512) )
image = glumpy.image.Image(numpy.random.random((32,32)).astype(numpy.float32))

@fig.event
def on_draw():
    fig.clear()
    image.draw( 0, 0, fig.width, fig.height )

glumpy.show()

and it shows the folowwing error
AttributeError: 'module' object has no attribute 'figure'
Please help as I am a newbie to Ubuntu..........

Nicolas Rougier

unread,
Jun 22, 2012, 1:37:15 AM6/22/12
to glumpy...@googlegroups.com


Did you import glumpy in your script ?

Erik Wyatt

unread,
Sep 9, 2012, 4:57:29 PM9/9/12
to glumpy...@googlegroups.com
I have the same error. Your suggestion of easy_install -U pyopengl does not fix the problem. Any other ideas? Is there a way to check whether or not I have freeglut?

Thanks for your help,

~Erik

Nicolas Rougier

unread,
Sep 10, 2012, 1:58:49 AM9/10/12
to glumpy...@googlegroups.com

Yes, in a python console type:

>>> import OpenGL
>>> import OpenGL.GLUT

Erik Wyatt

unread,
Sep 11, 2012, 12:09:52 AM9/11/12
to glumpy...@googlegroups.com
Both import commands run without error.

Something unusual about my installation that may be relevant--I am running 3.2 and ported glumpy using the 2to3 script included in most Python distributions.

Erik Wyatt

unread,
Sep 11, 2012, 12:24:21 AM9/11/12
to glumpy...@googlegroups.com
dir(OpenGL.GLUT) includes glutGetWindow.

>>> bool(OpenGL.GLUT.glutGetWindow)
False

>>> def stupid(): return 100
       ...
>>>bool(stupid)
True

What does passing a function as an argument to the bool constructor do?

Nicolas Rougier

unread,
Sep 11, 2012, 1:37:50 AM9/11/12
to glumpy...@googlegroups.com

Most probably it means that glut/freeglut is not installed on your system. the OpenGL.GLUT.glutGetWindow is a wrapper around the C function and if it cannot bind it, it is set to 0. Do you know what glut is installed and where are the libraries installed ?

Erik Wyatt

unread,
Sep 12, 2012, 5:42:24 PM9/12/12
to glumpy...@googlegroups.com
Ok, GLUT was indeed missing. I downloaded GLUT 3.7.6 and copied glut32.dll to the appropriate directories. bool(OpenGL.GLUT.glutGetWindow) returns True. However, I now get this lovely traceback when attempting to run anything:


Traceback (most recent call last):
  File "lena.py", line 35, in <module>
    fig   = glumpy.figure(size=(512,512))
  File "C:\Python32\lib\site-packages\glumpy\__init__.py", line 68, in figure
    return Figure(size=size, position=position, parent=None)
  File "C:\Python32\lib\site-packages\glumpy\figure.py", line 90, in __init__
    self._window = Window( size=(w,h), position=position, title='Figure')
  File "C:\Python32\lib\site-packages\glumpy\window\backend_glut.py", line 116,
in __init__
    self._id = glut.glutCreateWindow( self._title )
  File "C:\Python32\lib\site-packages\pyopengl-3.0.2b2-py3.2.egg\OpenGL\GLUT\spe
cial.py", line 71, in glutCreateWindow
    return __glutCreateWindowWithExit(title, _exitfunc)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

Thanks for your continuing help!

Nicolas Rougier

unread,
Sep 13, 2012, 1:48:26 AM9/13/12
to glumpy...@googlegroups.com

Argh ! Something's very wrong with glut. Could you run some examples from the PyOpenGL package to see if glut's working on your machine ?

Nicolas

Erik Wyatt

unread,
Sep 13, 2012, 1:00:25 PM9/13/12
to glumpy...@googlegroups.com
Well, you are correct that something is wrong with glut. I borrowed code from

http://www.de-brauwer.be/wiki/wikka.php?wakka=PyOpenGLHelloWorld

and got the following traceback:

  File "pyopenglhelloworld.py", line 24, in <module>
    glutInit()

  File "C:\Python32\lib\site-packages\pyopengl-3.0.2b2-py3.2.egg\OpenGL\GLUT\spe
cial.py", line 318, in glutInit
    holder[i] = arg
TypeError: bytes or integer address expected instead of str instance

Nicolas Rougier

unread,
Sep 14, 2012, 4:10:11 AM9/14/12
to glumpy...@googlegroups.com

At this point, maybe you should report the problem on the pyopengl mailing list.


Nicolas

Ravi Jonnal

unread,
Nov 7, 2013, 2:29:35 PM11/7/13
to glumpy...@googlegroups.com
Hello Nicolas and everyone.

I'm running 64-bit Python 2.7 on a 64-bit Windows 7 machine.

I initially installed PyOpenGL using pip, as described on the main PyOpenGL page (http://pyopengl.sourceforge.net/), and got the same glut-related errors. I uninstalled it and then installed using Christoph Gohlke's precompiled binary (PyOpenGL-3.0.2.win-amd64-py2.7) and now glut (and glumpy) work perfectly. Unfortunately I'm not sure whether I installed 3.0.1 or 3.0.2 using pip, initially.

Gohlke's binaries are here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Perhaps someone can install 3.0.2 from PyPI (https://pypi.python.org/pypi/PyOpenGL) and see if it works too? I'm too rushed now to continue exploring.

Thanks for glumpy, by the way. I love it.

-Ravi

Daniel Malendez

unread,
Mar 26, 2014, 10:06:16 PM3/26/14
to glumpy...@googlegroups.com
I had the same problem in Py3x. I figured out that the example contains glutCreateWindow("Drawdots") instead of glutCreateWindow(b"Drawdots"). After adding the b for byte literals it works.

DM
Reply all
Reply to author
Forward
0 new messages