How can i import OpenGL in anaconda python?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 15:12:15

问题


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.


回答1:


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



回答2:


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 *



回答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.



来源:https://stackoverflow.com/questions/25114792/how-can-i-import-opengl-in-anaconda-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!