# openGL not functioning in depth\_sensing sample of stereolabs

**URL:** <https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824>\
**Category:** Python\
**Tags:** python, depth\
**Created:** [March 24, 2024, 8:40pm UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824 "2024-03-24T20:40:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timo](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@Timo](https://community.stereolabs.com/u/Timo)\
**Post date:** [March 24, 2024, 8:40pm UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/1 "2024-03-24T20:40:12Z")

</div>

Hey I am Timo,  
I am new to the stereocamera and have only some python experience. I am trying to make a pointcloud of the surface captured by my stereocamera. I used the code provided by [stereolabs](https://www.stereolabs.com/) to create a live point cloud. This code can be found under samples → depth\_sensing for python. I have installed all required packages, but the code does not run and gives the below output. I am not very good at python, but how do I fix this issue so that I can retrieve my depth map? Thanks in advance.

PS C:\Users\Timod\Documents\bestanden\TU Delft\zed\Zed python\> & C:/Users/Timod/anaconda3/envs/zedpy/python.exe “c:/Users/Timod/Documents/bestanden/TU Delft/zed/Zed python/depth\_sensingmap.py”  
Running Depth Sensing sample … Press ‘Esc’ to quit  
Press ‘s’ to save the point cloud  
[Sample] Using default resolution  
Traceback (most recent call last):  
File “c:\Users\Timod\Documents\bestanden\TU Delft\zed\Zed python\depth\_sensingmap.py”, line 121, in   
main()  
^^^^^^  
File “c:\Users\Timod\Documents\bestanden\TU Delft\zed\Zed python\depth\_sensingmap.py”, line 90, in main  
viewer.init(1, sys.argv, camera\_model, res)  
File “c:\Users\Timod\Documents\bestanden\TU Delft\zed\Zed python\viewer.py”, line 229, in init  
glutInit(\_argc, \_argv)  
File “C:\Users\Timod\anaconda3\envs\zedpy\Lib\site-packages\OpenGL\GLUT\special.py”, line 333, in glutInit  
\_base\_glutInit( ctypes.byref(count), holder )  
File “C:\Users\Timod\anaconda3\envs\zedpy\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

---

<div class="post-metadata">

**Author:** ![JPlou](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jplou/32/1012_2.png) [@JPlou](https://community.stereolabs.com/u/JPlou)\
**Post date:** [March 25, 2024, 10:50am UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/2 "2024-03-25T10:50:21Z")

</div>

Hello @Timo, welcome to the forums!

You may need to update PyOpenGL, you can find the latest versions [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl).  
(I’m mostly quoting this [Github answer](https://github.com/stereolabs/zed-sdk/issues/319#issuecomment-737164652))

Replace “37” with your Python version (310 for 3.10 for instance), and download:

- PyOpenGL‑3.1.5‑cp37‑cp37m‑win\_amd64.whl
- PyOpenGL\_accelerate‑3.1.5‑cp37‑cp37m‑win\_amd64.whl

Then install them (in your env):  
`python3 -m pip install PyOpenGL_XXXX.whl`

---

<div class="post-metadata">

**Author:** ![Timo](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@Timo](https://community.stereolabs.com/u/Timo)\
**Post date:** [March 26, 2024, 3:16pm UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/3 "2024-03-26T15:16:01Z")

</div>

Thank you very much for your answer. Unfortunately, I have downloaded the right version of PyOpenGL and I tested this with a friend of mine, but still the same error occurs. How can I check which version I have installed, maybe that way I can double check. If I do have the correct version, is there something else that could be wrong?  
Thank you very much,  
Timo

---

<div class="post-metadata">

**Author:** ![JPlou](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jplou/32/1012_2.png) [@JPlou](https://community.stereolabs.com/u/JPlou)\
**Post date:** [March 26, 2024, 5:33pm UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/4 "2024-03-26T17:33:17Z")

</div>

@Timo  
You can use `pip show pyopengl` to see the version.

What version of Python are you using?  
Also, to confirm, you’re just trying to run the sample from the SDK, unmodified?

---

<div class="post-metadata">

**Author:** ![Timo](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@Timo](https://community.stereolabs.com/u/Timo)\
**Post date:** [March 26, 2024, 6:56pm UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/5 "2024-03-26T18:56:09Z")

</div>

Hello,  
I checked and the pyopengl version I have is 3.1.7. and the python version that I use is 3.11.8. I am trying to run the SDK sample. The depth\_sensing sample I am trying to get working is from the following link: [zed-sdk/depth sensing/depth sensing/python at master · stereolabs/zed-sdk · GitHub](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/depth%20sensing/python)  
I did not modify it or anything. I am only trying to run the unedited file. I have also copied the ogl\_viewer file so that is also in the same folder as the code. Hopefully this helps you to understand the problem.  
Thank you, hopefully you know what to do next,  
Timo

---

<div class="post-metadata">

**Author:** ![JPlou](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jplou/32/1012_2.png) [@JPlou](https://community.stereolabs.com/u/JPlou)\
**Post date:** [March 27, 2024, 10:18am UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/6 "2024-03-27T10:18:51Z")

</div>

Hello Timo,

I quickly checked on my side and while I don’t have a definite fix, for some reason it works with Python 3.10 but not Python 3.11.  
Can you try with a 3.10 version in your environment?

Edit: It could be a freeglut install issue: [python - PyOpenGL glutInit NullFunctionError - Stack Overflow](https://stackoverflow.com/questions/26700719/pyopengl-glutinit-nullfunctionerror)

---

<div class="post-metadata">

**Author:** ![Timo](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@Timo](https://community.stereolabs.com/u/Timo)\
**Post date:** [March 27, 2024, 5:16pm UTC](https://community.stereolabs.com/t/opengl-not-functioning-in-depth-sensing-sample-of-stereolabs/4824/7 "2024-03-27T17:16:25Z")

</div>

Thank you very much for your help! Using python 3.10 definitely works and I will use that for my experiments.
