Question

I wanted to start with some PyOpenGL, and so I booted into Mac Osx to try it. I went on the PyOpenGl website, downloaded the PyOpenGl and PyOpenGl_accelerate tars, cd'd into my downloads directory, and typed these commands into terminal to install:

tar -zxvf PyOpenGL-3.0.2.tar.gz
cd PyOpenGL-3.0.2
python3 setup.py install #I changed 'python' to 'python3' to install it to my python3. 

next, i typed these to install the accelerate package

tar -zxvf PyOpenGL-accelerate-3.0.2.tar.gz
cd PyOpenGL-accelerate-3.0.2
python3 setup.py install #Again, 'python' replaced with 'python3'

Finally, I ran this code to test the install

python3
>>>from OpenGL.GL import *

which gave me this lovely string of errors

    Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/PyOpenGL-3.0.2-py3.3.egg/OpenGL/GL/__init__.py", line 3, in <module>
    from OpenGL.GL.VERSION.GL_1_1 import *
  File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/PyOpenGL-3.0.2-py3.3.egg/OpenGL/GL/VERSION/GL_1_1.py", line 10, in <module>
    from OpenGL import platform, constants, constant, arrays
  File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/PyOpenGL-3.0.2-py3.3.egg/OpenGL/arrays/__init__.py", line 19, in <module>
    from OpenGL.arrays.arraydatatype import *
  File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/PyOpenGL-3.0.2-py3.3.egg/OpenGL/arrays/arraydatatype.py", line 14, in <module>
    from OpenGL_accelerate.arraydatatype import ArrayDatatype as ADT
  File "arraydatatype.pyx", line 1, in init OpenGL_accelerate.arraydatatype (src/arraydatatype.c:9315)
  File "wrapper.pyx", line 2, in init OpenGL_accelerate.wrapper (src/wrapper.c:10792)
ValueError: level must be >= 0

Any idea why it's acting up like this?

EDIT: managed to get pyopengl working for python3 with following command:

sudo pip-3.3 install PyOpenGL

So... problem solved I guess...

Was it helpful?

Solution

Answering my own question here, I managed to get PyOpenGL working with the command

sudo pip-3.3 install PyOpenGl
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top