How can i import OpenGL in anaconda python?

2019-07-01 15:07发布

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.

3条回答
ら.Afraid
2楼-- · 2019-07-01 15:27

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
查看更多
贪生不怕死
3楼-- · 2019-07-01 15:31

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 *
查看更多
唯我独甜
4楼-- · 2019-07-01 15:34

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.

查看更多
登录 后发表回答