I use ipython notebook on anaconda python but i have no idea how to install or import opengl. Can anyone help me solve this ? I use anaconda on linux xubuntu. Sorry for bad english.

- 56,802
- 26
- 179
- 234

- 377
- 2
- 3
- 17
-
Which OS u are using ? – Nilesh Aug 04 '14 at 08:46
-
You probably need to set up a virtualenv for your IPython Notebook where you install all packages: http://opensourcehacker.com/2012/09/16/recommended-way-for-sudo-free-installation-of-python-software-with-virtualenv/ – Mikko Ohtamaa Aug 04 '14 at 11:36
3 Answers
As pointed out by David, Vispy provides OpenGL bindings for OpenGL ES 2.0. More interesting about vispy is vispy.gloo
which provides a much easier (object oriented) way to use OpenGL.
If you need full desktop OpenGL functionality (not limited to ES 2.0), you need PyOpenGL. I think that currently it is supported (at least on Linux). This works for me:
conda install pyopengl
Alternatively, pip should work as well:
pip install pyopengl

- 4,756
- 2
- 13
- 9
From anaconda, you can pip install Vispy, which is a numpy OpenGL data visualization framework that happens to provide a set of OpenGL ES 2.0 bindings via vispy.gloo.gl.
pip install vispy
from vispy.gloo.gl import *
Vispy uses anaconda's PyQt4 for the QtOpenGL context. The github repo has plenty of nice examples that show its potential beyond providing OpenGL bindings.
Pyglet also offers a fairly complete set of OpenGL Python bindings.
pip install pyglet
>> from pyglet.gl import *

- 51
- 3
I assume you are using anaconda on Windows... Following the discussions on G Groups there is currently (Sept.2013) no time frame set for the inclusion of PyOpenGL in the anaconda package. However, it should be possible to use the binaries from Chris Gohlke's site.

- 19,815
- 6
- 75
- 94
-
Sorry not to tell earlier,but i use anaconda on xubuntu. Anyway, thanks for your reply – kekhuay Aug 05 '14 at 00:14