Glew could not be initialized- Setting up paraview for python shell usage

I am just trying to get paraview to work from a python shell.

from paraview.simple import *
cone = Cone()
Show(cone)
Render()

But this keeps giving me error like this

ERROR:In/home/conda/feedstock_root/build_artifacts/paraview_1532760595263/work/VTK/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 781 vtkOSOpenGLRenderWindow (0x556661755060): GLEW could not be initialized.ERROR:In/home/conda/feedstock_root/build_artifacts/paraview_1532760595263/work/VTK/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 781 vtkOSOpenGLRenderWindow (0x556661755060): GLEW could not be initialized.

I installed both vtk and paraview using conda so that I dont have to set up path variables.

I tried to build paraview seperately as well and set up path variables for paraview in my python shell. The code shown above then gives me an error like this.

ImportError: No module named vtkCommonCorePython

Hello,

Can you confirm the verion of python, paraview and your environement.

I have a similar problem using vtk enbeded on a QT app on python 3 (anaconda) on a distance machique using vnc.

maybe relattes issues:

https://www.paraview.org/pipermail/paraview-developers/2018-March/005829.html

http://vtk.1045678.n5.nabble.com/VTK-OpenGL2-application-over-VirtualGL-TurboVNC-td5742948.html

Felipe

Thanks for your reply Felipe !

I am using Python 2.7 with a paraview version of 5.5.2 on Mint 19 .
The application that I am writing has to run on a local machine so I dont think using vnc would be of any help.
Currently I am using pvpbatch via a batchscript being called from an python script for my application. It seems to work but this whole setup dosent sound very stable to me.

Paraview by itself works fine as well.

I end up getting similar errors when I compile Paraview without conda and set up my environment variables manually so i guess the problem really lies with vtk , openGL2 and my nvidia card.

Let me know if you figure something out !

Pradyumn

Hi Pradyumn,
What environment variables did you defined?
I am facing this problems too…