# Opengl problem zed 2 camera

**URL:** <https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162>\
**Category:** Uncategorized\
**Created:** [March 21, 2021, 8:07am UTC](https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162 "2021-03-21T08:07:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlraro](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dlraro](https://community.stereolabs.com/u/dlraro)\
**Post date:** [March 21, 2021, 8:07am UTC](https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162/1 "2021-03-21T08:07:14Z")

</div>

Hello Everyone

I have installed all the requirements and i have run a couple of demos but when i try to run object\_detection\_image\_viewer.py it gives me this error

OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

I am currently running it on windows 10  
Cuda 10.2  
and an RTX 5000  
if that information helps

I’m running it on my base environment and i have all the packages installed i have been able to use the Zed explorer and so on. but not to run the python script , object detection  
im using python 3.6.8 and this is the packages that i have installed

![image](https://community.stereolabs.com/uploads/default/original/1X/b45c0c370d762c84dc1fd195a31aa0ba21562b56.png)

---

<div class="post-metadata">

**Author:** ![dlraro](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dlraro](https://community.stereolabs.com/u/dlraro)\
**Post date:** [March 21, 2021, 10:09am UTC](https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162/2 "2021-03-21T10:09:01Z")

</div>

this is the full error

Traceback (most recent call last):  
File “C:/Program Files (x86)/ZED SDK/samples/object detection/birds eye viewer/python/object\_detection\_birds\_view.py”, line 71, in   
viewer.init(camera\_model, res)  
File “C:\Program Files (x86)\ZED SDK\samples\object detection\birds eye viewer\python\ogl\_viewer\viewer.py”, line 412, in init  
glutInit(sys.argv)  
File “C:\Users\EmTech\AppData\Local\Programs\Python\Python36\lib\site-packages\OpenGL\GLUT\special.py”, line 333, in glutInit  
\_base\_glutInit( ctypes.byref(count), holder )  
File “C:\Users\EmTech\AppData\Local\Programs\Python\Python36\lib\site-packages\OpenGL\platform\baseplatform.py”, line 425, in **call**  
self. **name** , self. **name** ,  
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

---

<div class="post-metadata">

**Author:** ![quythao.truong](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/q/c68b51/32.png) [@quythao.truong](https://community.stereolabs.com/u/quythao.truong)\
**Post date:** [March 22, 2021, 10:14am UTC](https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162/3 "2021-03-22T10:14:25Z")

</div>

Hi @dlraro,

Sorry for the late reply.  
As you already seem to have the required PyOpenGL packages, can you try following the suggestion on [that page](https://stackoverflow.com/questions/39181192/attempt-to-call-an-undefined-function-glutinit) and see if it helps with your issue ?  
The suggested workaround is to download [this package](https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MSVC.zip) and place `freeglut.dll` in the folder of the python script you are trying to run

---

<div class="post-metadata">

**Author:** ![Sky](https://community.stereolabs.com/user_avatar/community.stereolabs.com/sky/32/113_2.png) [@Sky](https://community.stereolabs.com/u/Sky)\
**Post date:** [April 21, 2021, 2:16am UTC](https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162/4 "2021-04-21T02:16:10Z")

</div>

Hello.  
I’m having a similar issue while trying to run Spatial Mapping example.

Traceback (most recent call last):  
File “D:/SkyOcean/UMS/SW/ZED2/zed\_test.py”, line 299, in   
spatial\_mapping()  
File “D:/SkyOcean/UMS/SW/ZED2/zed\_test.py”, line 196, in spatial\_mapping  
viewer.init(camera\_params, pymesh)  
File “D:\SkyOcean\UMS\SW\ZED2\ogl\_viewer\viewer.py”, line 211, in init  
glutInit()  
File “D:\SkyOcean\UMS\SW\ZED2\venv\lib\site-packages\OpenGL\GLUT\special.py”, line 333, in glutInit  
\_base\_glutInit( ctypes.byref(count), holder )  
File “D:\SkyOcean\UMS\SW\ZED2\venv\lib\site-packages\OpenGL\platform\baseplatform.py”, line 425, in **call**  
self. **name** , self. **name** ,  
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

I’ve been searching for a fix and followed your instruction.

- downloaded ‘glut.dll’, ‘glut32.dll’, and ‘freeglut.dll’
- copied them into the folder of my python working folder.
- I also copied them into the windows system folders ( SysWOW64 and System32 )  
The problem still exist.  
Any idea why it’s not fixed?  
I have followed tutorials from HelloZED to Positional Tracking and had no issues.

Just fixed it by reinstalling ‘pyopengl’ and ‘pyopengl-accelerate’.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Zber](https://community.stereolabs.com/user_avatar/community.stereolabs.com/zber/32/156_2.png) [@Zber](https://community.stereolabs.com/u/Zber)\
**Post date:** [June 18, 2021, 12:34pm UTC](https://community.stereolabs.com/t/opengl-problem-zed-2-camera/162/5 "2021-06-18T12:34:05Z")

</div>

The main reason is that your windows are 64-bit, but after installing using the command pip install pyopengl, the execution example uses pyopengl\_32 bit by default, so the above error occurs!

Uninstall first then reinstall PyOpenGl and PyOpenGL-accelerate manually.  
Download wheel files here: [Python Extension Packages for Windows - Christoph Gohlke](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl)  
Select the correct file by checking file name with your system version (should be 64bits) and your python verison (choose cp37 if your python version is 3.7)
