0

I am trying to run a simple python program, importing the paraview.simple module:

from paraview.simple import *

I get the following error:

Error: Could not import vtkCommonComputationalGeometry

I looked at similar posts on different fora and tried everything that was suggested there, but nothing worked for me. My Python path includes:

ParaView-5.7.0-MPI-Linux-Python2.7-64bit/bin/
ParaView-5.7.0-MPI-Linux-Python2.7-64bit/lib
ParaView-5.7.0-MPI-Linux-Python2.7-64bit/lib/python2.7/site-packages/

My LD_LIBRARY_PATH includes:

ParaView-5.7.0-MPI-Linux-Python2.7-64bit/lib/python2.7/site-packages/vtkmodules/

Does anybody know how to fix it?


Update: I think there is an underline issue regarding the Unicode variant my python interpreter is using. I now get the following error: Unicode error

ImportError: /home/nick/ParaView-5.7.0-MPI-Linux-Python2.7-64bit/lib/python2.7/site-packages/vtkmodules/vtkCommonCorePython.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

Does anybody know a fix?

  • Looks like an incompatibility between the Python that ParaView was compiled with and the Python you are trying to use. See: https://stackoverflow.com/questions/11878666/python-undefined-symbol-pyunicodeucs2-decodeutf8 – Cory Quammen Dec 02 '19 at 14:18

1 Answers1

1

You may want to use the pvpython program that is bundled with ParaView. It is basically a python interpreter but already setup with the correct paths.

If you want to use an external interpreter, you have to setup the PYTHONPATH environment variable to ParaView-5.7.0-MPI-Linux-Python2.7-64bit/lib/python2.7/site-packages/ and the LD_LIBRARY_PATH (on linux, PATH on windows) to ParaView-5.7.0-MPI-Linux-Python2.7-64bit/lib.

See also the ParaViewTutorial pdf from the download page (https://www.paraview.org/download/), at 3.1 Starting the Python Interpreter

Nico Vuaille
  • 2,310
  • 1
  • 6
  • 14