0

when i try to import Opengl to my python code i get an error. this is the error message:

from OpenGL.GLU.projection import *

  File "C:\Users\GAREH\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopengl-3.1.3b1-py3.7.egg\OpenGL\GLU\projection.py", line 3, in <module>
    from OpenGL import GL
  File "C:\Users\GAREH\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopengl-3.1.3b1-py3.7.egg\OpenGL\GL\__init__.py", line 6, in <module>
    from OpenGL.GL.images import *
  File "C:\Users\GAREH\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopengl-3.1.3b1-py3.7.egg\OpenGL\GL\images.py", line 628, in <module>
    suffix, arrayConstant, getattr(GL_1_1,functionName),
  File "C:\Users\GAREH\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopengl-3.1.3b1-py3.7.egg\OpenGL\GL\images.py", line 578, in typedImageFunction
    if baseFunction:
  File "C:\Users\GAREH\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopengl-3.1.3b1-py3.7.egg\OpenGL\platform\baseplatform.py", line 382, in __nonzero__
    self.load()
  File "C:\Users\GAREH\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopengl-3.1.3b1-py3.7.egg\OpenGL\platform\baseplatform.py", line 397, in load
    force_extension = self.force_extension,
TypeError: constructFunction() got an unexpected keyword argument 'force_extension'*
BDL
  • 21,052
  • 22
  • 49
  • 55
harounbest
  • 61
  • 1
  • 13
  • You are importing GLU, not OpenGL. – BDL Sep 03 '18 at 11:19
  • yes i face the same problem for Glu, Glut and Gl – harounbest Sep 03 '18 at 12:16
  • @harounbest not a python user but I think you should rearrange your imports as GLU and GLUT are depending on the GL so GL should be imported first .... In C++ I use this order: `#define GLEW_STATIC \r\n #include "glew.c" \r\n #include \r\n #include \r\n` ... In case you got correct order you might missing some header or define/switch before it ... – Spektre Sep 04 '18 at 08:13
  • thnak you @Spektre, and yes you are right when it is about c++, but in pyhton it does not really matter – harounbest Sep 04 '18 at 08:26
  • Do you import OpenGL.GL before GLU? Does that work? – Hugh Fisher Sep 05 '18 at 22:23
  • yes @HughFisher i did, but it doesn't work either – harounbest Sep 06 '18 at 07:36

0 Answers0