regarding povray and vtk installation

Asked by M K SINGH

Hi,
I have one small question regarding installtion of povray and vtk visulization tool. When I install Esys, is it automatically installed with the Esys or not? If not then what I have to do extra to get installed these two visulaization? I see that when my system administrator tries to install Esys, the two tools are missing in /lib/python2.4/site-packeges/esys/lsm/vis/
Thanks in advance.
M K

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Vince Boros
Solved:
Last query:
Last reply:
Revision history for this message
SteffenAbe (s-abe) said :
#1

SteffenAbe suggests this article as an answer to your question:
FAQ #712: “How do I install ESyS-Particle from source code?”.

Revision history for this message
SteffenAbe (s-abe) said :
#2

Neither povray nor any of the VTK-based visualisation tools (i.e. Paraview, Visit or Mayavi) are included in the ESyS-Particle package.
To install Povray you either need to download and install the povray-package from your Linux distribution (in Debian or Ubuntu you need "povray" and "povray-includes", don't know which distribution you're using) or download the package (either binary or source) from www.povray.org (see also the FAQ on "How do I install ESyS-Particle from source code?").

To install Paraview (IMHO the one of the VTK-based viz tools which is easiest to use) the best option is to download and install the binaries directly from www.paraview.org. The versions of Paraview supplied by most Linux distributions tend to be out of date (i.e. Debian and Ubuntu both supply Paraview 3.2 while 3.6 is current).

Steffen

Revision history for this message
M K SINGH (mrityunjay111) said :
#3

Dear Steffen,
My system administrator tried to install the povray and vtk and again I tried to run the bingle_vis.py by using the command
========================================
mpirun -np 2 `which mpipython` bingle_vis.py
======================================
I get this message (for your refernce Diego Peinado Martín compiled my code and he did not get the error).
------------------------------------------------------------------------------------------------------
CSubLatticeControler::initMPI()
Traceback (most recent call last):
  File "bingle_vis.py", line 13, in ?
    from esys.lsm.vis import povray
  File "/apps/esys-particle/lib/python2.4/site-packages/esys/lsm/vis/__init__.py", line 19, in ?
    import vtk
  File "/apps/esys-particle/lib/python2.4/site-packages/esys/lsm/vis/vtk/__init__.py", line 18, in ?
    from Arrow import *
  File "/apps/esys-particle/lib/python2.4/site-packages/esys/lsm/vis/vtk/Arrow.py", line 17, in ?
    import vtk as kwvtk # Kitware's vtk package
ImportError: No module named vtk
-----------------------------------------------------------------------------------------------
I have two questions in bingle_vis.py I am not importing vtk even it is seraching for vtk, second I have already vtk module even I am getting the error.
Could you help me in this regard.
M K

Revision history for this message
SteffenAbe (s-abe) said :
#4

Could be a python path issue. Try to see if the location of the python packages from VTK is in your python path and if not add that location to PYTHONPATH. Don't know where the VTK python packages are located exactly - that seems to be system dependent.

Steffen

Revision history for this message
Vince Boros (v-boros) said :
#5

Hi M. K.:

If Steffen's suggestion does not work with your installation, for the time being you can disable vtk (since the tutorials use only povray). To do this:

  sudo make uninstall
  make distclean
  ./configure CC=mpicc CXX=mpic++ --without-epydoc --without-vtk
  make -j X # where X is the number of processor cores
  sudo make install

Your system administrator can use the same "configure" prefixes as previously, with the addition of the "--without-vtk" switch.

I will in the meantime endeavour to resolve the missing vtk module problem.

Vince

Revision history for this message
Best Vince Boros (v-boros) said :
#6

Hello M. K.:

I have been able to replicate on our supercomputer the "import vtk" error you reported. When I built ESyS-Particle, I had vtk in the PATH, LD_LIBRARY_PATH and PYTHONPATH, but not when I subsequently ran a simulation.

If you at least add the python vtk path to PYTHONPATH, your simulations should then work. If vtk libraries and the vtkpython binary are not in default system locations, you will also need to update LD_LIBRARY_PATH and PATH.

Regards,

Vince

Revision history for this message
M K SINGH (mrityunjay111) said :
#7

Thanks

Revision history for this message
Vince Boros (v-boros) said :
#8

The following information may help if anyone still gets an "ImportError" message related to vtk.

I have recently experienced the "import vtk" error on my system, which turned out to be a path problem. The problem is not specific to ESyS-Particle, but to Python and vtk generally. Run "python" and then type "import vtk" at the Python prompt to verify this. On my system I have libvtk*.so libraries in /usr/lib/python-support/python-vtk/python2.6/vtk/ and various vtk python scripts (including __init__.py) in /usr/share/python-support/python-vtk/vtk/. Links to the files in these two folders are in /var/lib/python-support/python2.6/vtk, which I had to add to the PYTHONPATH environment variable to remove the error message.

The precise path may vary on your system. For example, you may use Python 2.7 instead of Python 2.6. If you have installed vtk as a package, run "dpkg -L python-vtk" to determine names and locations of files that Python needs in order to import vtk. From this information you can then locate the links with the "find" utility.

Thanks to Cihan Altinay for his generosity in providing tips and tricks related to this issue.

Best regards,

Vince Boros