D
D
Dmitry2020-03-30 06:53:04
Python
Dmitry, 2020-03-30 06:53:04

PyOpenGL doesn't install GLUT, why is that?

Installed PyOpenGL via terminal, libraries are visible, modules are imported without problems, but the following code

from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import sys

glutInit()
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
glutInitWindowSize(300, 300)
glutInitWindowPosition(50, 50)
glutInit(sys.argv)
glutCreateWindow(b"Happy New Year!")
glutMainLoop()


gives an error message

C:\PyCharm\projects\runner\venv\Scripts\python.exe C:/PyCharm/projects/runner/ruiner.py
Traceback (most recent call last):
  File "C:/PyCharm/projects/runner/ruiner.py", line 6, in <module>
    glutInit()
  File "C:\PyCharm\projects\runner\venv\lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit
    _base_glutInit( ctypes.byref(count), holder )
  File "C:\PyCharm\projects\runner\venv\lib\site-packages\OpenGL\platform\baseplatform.py", line 423, in __call__
    raise error.NullFunctionError(
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

Process finished with exit code 1


ps seems to be swearing at GLUT, but as I not only tried, all to no avail

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2020-04-08
@nosochek

In general: installation via -pip incorrectly installs glut, if you really need a library, then install it through the "wheel", but you have to get confused with finding the right file, I couldn't find it for myself (

A
agentx24, 2020-09-28
@agentx24

I'm just studying this nightmare at the university - fly into the link with whl packages.
The accelerate version doesn't work without the normal one. Where cpXX is the Python version number. Put only the appropriate one, because will swear long and tedious.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question