[Paraview] Importing paraview.simple from python

Zhou, Fangyi fangyi.zhou15 at imperial.ac.uk
Mon Aug 8 07:52:25 EDT 2016


Dear All

I’m trying to import paraview.simple from python and I get this error message:

Running on Linux:

Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview.simple
Error: Could not import vtkCommonComputationalGeometry
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/paraview-5.1/site-packages/paraview/simple.py", line 39, in <module>
    import servermanager
  File "/usr/local/lib/paraview-5.1/site-packages/paraview/servermanager.py", line 52, in <module>
    from paraview import vtk
  File "/usr/local/lib/paraview-5.1/site-packages/paraview/vtk/__init__.py", line 7, in <module>
    from vtkCommonCore import *
  File "/usr/local/lib/paraview-5.1/site-packages/paraview/vtk/vtkCommonCore.py", line 15, in <module>
    from vtkCommonKitPython import *
ImportError: No module named vtkCommonKitPython

The envs have been set as follows
>>> os.environ["PYTHONPATH"]
'/usr/local/lib/paraview-5.1:/usr/local/lib/paraview-5.1/site-packages:/paraview/lib'
>>> os.environ["LD_LIBRARY_PATH"]
'/usr/local/lib/paraview-5.1:/usr/local/lib/paraview-5.1/site-packages’

The intention of importing the modules of paraview to python instead of pvpython is that the simulation script needs to be run under virtualenv. 
If there are alternatives ways to get over it, it would be appreciated.

Thanks in advance.

Regards

Fangyi Zhou


More information about the ParaView mailing list