# Python VTK Windows OpenGL error

**URL:** https://discourse.vtk.org/t/python-vtk-windows-opengl-error/6040
**Category:** Support
**Created:** [June 22, 2021, 4:16pm UTC](https://discourse.vtk.org/t/python-vtk-windows-opengl-error/6040 "2021-06-22T16:16:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GuillaumeJacquenot](https://discourse.vtk.org/user_avatar/discourse.vtk.org/guillaumejacquenot/32/3590_2.png) [@GuillaumeJacquenot](https://discourse.vtk.org/u/GuillaumeJacquenot)
#### Post date: [June 22, 2021, 4:16pm UTC](https://discourse.vtk.org/t/python-vtk-windows-opengl-error/6040/1 "2021-06-22T16:16:49Z")

</div>

Hello dear VTK developers / users

I am trying to use vtk 9.0.1 from python 3.8.1 on a Windows 10 machine with Intel Graphics UHD 620.

Unfortunately, when I try to open a window, I have a nasty OpenGL error.

Does anyone have a clue (installation of something, or PATH to update…)

python --version  
Python 3.8.1

python -m pip install vtk

import vtk  
renderer = vtk.vtkRenderer()  
window = vtk.vtkRenderWindow()  
window.AddRenderer(renderer)  
window.Render()  
print(vtk.VTK\_VERSION)  
‘9.0.1’

2021-06-22 17:08:18.097 ( 0.286s) []vtkWin32OpenGLRenderWin:561 ERR| vtkWin32OpenGLRenderWindow (0000022651F86B10): failed to create temporary windows OpenGL context with error: 0  
2021-06-22 17:08:18.116 ( 0.304s) []vtkWin32OpenGLRenderWin:569 ERR| vtkWin32OpenGLRenderWindow (0000022651F86B10): GLEW could not be initialized.  
2021-06-22 17:08:18.121 ( 0.310s) []vtkOpenGLRenderWindow.c:569 ERR| vtkWin32OpenGLRenderWindow (0000022651F86B10): GLEW could not be initialized: Missing GL version

I think my laptop is able to open a 3D windows, since I can use ParaView 5.6.2 and create a 3D views

Here is the info I have from the excellent ParaView

Version 5.6.2 64-bit  
Qt Version 5.12.3  
Architecture 64  
vtkIdType size 64bits Embedded  
Python On  
Python Library Version 2.7.15 (default, Sep 5 2018, 14:22:01) [MSC v.1500 64 bit (AMD64)]  
Python Numpy Support On  
Python Numpy Version 1.15.1  
Python Matplotlib Support On  
Python Matplotlib Version 1.1.1  
Python Testing Off  
MPI Enabled Off  
Disable Registry Off  
OpenGL Vendor Intel  
OpenGL Version 3.2.0 - Build 27.20.100.9466  
OpenGL Renderer Intel Graphics UHD 620

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [June 23, 2021, 5:22am UTC](https://discourse.vtk.org/t/python-vtk-windows-opengl-error/6040/2 "2021-06-23T05:22:10Z")

</div>

Do the latest Paraview and the latest 3D Slicer Preview Release work well on your computer?

---

<div class="post-metadata">

### Author: ![GuillaumeJacquenot](https://discourse.vtk.org/user_avatar/discourse.vtk.org/guillaumejacquenot/32/3590_2.png) [@GuillaumeJacquenot](https://discourse.vtk.org/u/GuillaumeJacquenot)
#### Post date: [June 23, 2021, 7:10am UTC](https://discourse.vtk.org/t/python-vtk-windows-opengl-error/6040/3 "2021-06-23T07:10:22Z")

</div>

I have just tested ParaView 5.9.1, and the program paraview.exe works perfectly!

Running a Python script from the “Python shell” window also works great.

However, if I use pvpython.exe form ParaView 5.9.1, I have the same error as if using a classic python.exe with vtk package installed with pip (Same version Python 3.8.6 and VTK 9)

It may be a PATH problem? An initiliatisation that is different between ParaView and (PvPython or Python + VTK)?

C:\ParaView-5.9.1-Windows-Python3.8-msvc2017-64bit\bin\pvpython.exe bug\_vtk2.py  
( 0.271s) [paraview]vtkWin32OpenGLRenderWin:622 ERR| vtkWin32OpenGLRenderWindow (00000218615B6830): failed to create temporary windows OpenGL context with error: 0  
( 0.275s) [paraview]vtkWin32OpenGLRenderWin:630 ERR| vtkWin32OpenGLRenderWindow (00000218615B6830): GLEW could not be initialized.  
( 0.279s) [paraview]vtkOpenGLRenderWindow.c:458 ERR| vtkWin32OpenGLRenderWindow (00000218615B6830): GLEW could not be initialized: Missing GL version

I am using the test script provided here: [https://kitware.github.io/vtk-examples/site/Python/Tutorial/Tutorial\_Step1/](https://kitware.github.io/vtk-examples/site/Python/Tutorial/Tutorial_Step1/)

Client Information:  
Version: 5.9.1  
VTK Version:  
Qt Version: 5.15.1  
vtkIdType size: 64bits  
Embedded Python: On  
Python Library Path: C:\ParaView-5.9.1-Windows-Python3.8-msvc2017-64bit\bin\lib  
Python Library Version: 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]  
Python Numpy Support: On  
Python Numpy Path: C:\ParaView-5.9.1-Windows-Python3.8-msvc2017-64bit\bin\Lib\site-packages\numpy  
Python Numpy Version: 1.19.2  
Python Matplotlib Support: On  
Python Matplotlib Path: C:\ParaView-5.9.1-Windows-Python3.8-msvc2017-64bit\bin\Lib\site-packages\matplotlib  
Python Matplotlib Version: 3.2.1  
Python Testing: Off  
MPI Enabled: Off  
Disable Registry: Off  
Test Directory:  
Data Directory:  
OpenGL Vendor: Intel  
OpenGL Version: 3.2.0 - Build 27.20.100.9466  
OpenGL Renderer: Intel(R) UHD Graphics 620

Connection Information:  
Remote Connection: No
