Impossible to solve Glut for OpenGL

Hello,
I use Python 3.11 and Windows, and I have installed Opengl, and put freegllut.dll in serveral folders.
But gluinit is no recognized

from OpenGL.GLUT import *
import sys
import ogl_viewer.viewer as gl
import pyzed.sl as sl
import argparse

Check if glutInit is available

if hasattr(GLUT, ‘glutInit’):
print(“glutInit is available”)
glutInit(sys.argv)
else:
print(“glutInit is not available”)

Could you help ? Thx

Hi @cjacquel,

Can you make sure that the python environment with which you are running the application contains the PyOpenGL package?

You can verify this using the command:

python3 -m pip freeze

The result is :

certifi==2024.6.2
charset-normalizer==3.3.2
Cython==3.0.10
durationpy==0.6
idna==3.7
numpy==1.26.4
opencv-python==4.10.0.82
PyOpenGL==3.1.7
PyOpenGL-accelerate==3.1.7
python-dateutil==2.9.0.post0
pyzed==1.3.0
requests==2.32.3
six==1.16.0
urllib3==2.2.1

The library is included in the environment.
Thx
Le 2024-06-18 16:53, Matthew Rousseau (Stereolabs) a écrit :

Hi @cjacquel,

Does the script you run return any other logs or errors related to glut not being detected?

Hello, Please find the data :slight_smile:

Running Depth Sensing sample … Press ‘Esc’ to quit
Press ‘s’ to save the point cloud
[Sample] Using default resolution
[2024-06-19 11:57:21 UTC][ZED][INFO] Logging level INFO
[2024-06-19 11:57:22 UTC][ZED][INFO] Using USB input… Switched to default resolution HD720
[2024-06-19 11:57:23 UTC][ZED][INFO] [Init] Depth mode: ULTRA
[2024-06-19 11:57:24 UTC][ZED][INFO] [Init] Camera successfully opened.
[2024-06-19 11:57:24 UTC][ZED][INFO] [Init] Camera FW version: 1523
[2024-06-19 11:57:24 UTC][ZED][INFO] [Init] Video mode: HD720@60
[2024-06-19 11:57:24 UTC][ZED][INFO] [Init] Serial Number: S/N 13473
Traceback (most recent call last):
File “C:\Users\c.jacquelin\PycharmProjects\testAPIZED\main.py”, line 128, in
main()
File “C:\Users\c.jacquelin\PycharmProjects\testAPIZED\main.py”, line 97, in main
viewer.init(1, sys.argv, camera_model, res)
File “C:\Users\c.jacquelin\PycharmProjects\testAPIZED\ogl_viewer\viewer.py”, line 237, in init
glutInit(_argc, _argv)
File “C:\Users\c.jacquelin\PycharmProjects\testAPIZED.venv\Lib\site-packages\OpenGL\GLUT\special.py”, line 333, in glutInit
_base_glutInit( ctypes.byref(count), holder )
File “C:\Users\c.jacquelin\PycharmProjects\testAPIZED.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

Please help but do help
Thank you,

Hi @cjacquel,

Sorry for the late reply, we are not able to reproduce the issue on our end.

Would you be able to test the solution from this post: python - PyOpenGL :: OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling - Stack Overflow?