CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Prblems with pyFoamPVSnapshot-PATHS in OF-2.0.1 (http://www.cfd-online.com/Forums/openfoam-post-processing/108162-prblems-pyfoampvsnapshot-paths-2-0-1-a.html)

klio October 16, 2012 06:02

Prblems with pyFoamPVSnapshot-PATHS in OF-2.0.1
 
Hi!!

I'd like to do a snapshot with pyFoamPVSnapshot! I set the paths as its said in README of ThirdParty-2.0.x/ParaView-3.10.1/VTK/Wrapping/Python/README.txt

But it even caused following Error:

pyFoamPVSnapshot.py --state-file=state.pvsm --latest-time state1
Traceback (most recent call last):
File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
from PyFoam.Applications.PVSnapshot import PVSnapshot
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
from paraview import servermanager
File "/usr/lib/pymodules/python2.6/paraview/servermanager.py", line 43, in <module>
import paraview, re, os, new, sys, vtk
File "/usr/lib/pymodules/python2.6/paraview/vtk/__init__.py", line 4, in <module>
from libvtkCommonPython import *
ImportError: No module named libvtkCommonPython

may it is an important information that i have installed OF as discribed on this WebPage:
http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html

I don't know what to do ....

gschaider October 18, 2012 17:39

Quote:

Originally Posted by klio (Post 386839)
Hi!!

I'd like to do a snapshot with pyFoamPVSnapshot! I set the paths as its said in README of ThirdParty-2.0.x/ParaView-3.10.1/VTK/Wrapping/Python/README.txt

But it even caused following Error:

pyFoamPVSnapshot.py --state-file=state.pvsm --latest-time state1
Traceback (most recent call last):
File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
from PyFoam.Applications.PVSnapshot import PVSnapshot
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
from paraview import servermanager
File "/usr/lib/pymodules/python2.6/paraview/servermanager.py", line 43, in <module>
import paraview, re, os, new, sys, vtk
File "/usr/lib/pymodules/python2.6/paraview/vtk/__init__.py", line 4, in <module>
from libvtkCommonPython import *
ImportError: No module named libvtkCommonPython

may it is an important information that i have installed OF as discribed on this WebPage:
http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html

I don't know what to do ....

The problem seems to be that python can't find the dynamic library libvtkCommonPython.so which implements the python-module libvtkCommonPython. pyFoamPVSnapshot.py uses pvpython as an interpreter. pvpython is a special python version that should set the paths appropriately so that these module is found. So it seems that there is a problem with the paraview-installation.

On the OS-shell type

pvpython

A python-shell should appear. There you type

import paraview

Should one of these steps fail then the installation of paraview is the problem

klio October 19, 2012 02:51

Thank you!

But it didn't work! (I was able to folow your setps without failures but NO)

I also tried to add the path where the libvtk... .so File is to the PYTHONPATH!
I have installed python-vtk.

Nothing worked!

gschaider October 19, 2012 05:47

Quote:

Originally Posted by klio (Post 387446)
Thank you!

But it didn't work! (I was able to folow your setps without failures but NO)

I don't quite get what didn't work. Please remember: it is your problem. So what "it" means is clear to you but not necessarily to anyone else (and not many people care about it as much as you do). So try to be short, but precise. "But NO" is what I say to putting further effort into this problem if I have to ask for clarification what "but NO" means

Quote:

Originally Posted by klio (Post 387446)
I also tried to add the path where the libvtk... .so File is to the PYTHONPATH!
I have installed python-vtk.

As I understand it the VTK that comes with Paraview is not exactly compatible to the "normal" VTK. So maybe your problem is that they're mixed.

If "normal" pvpython works (but you're terribly unclear there) try calling the script with

pvpython <fullPathToScript>/pyFoamPVSnapShot.py <your parameters>

klio October 23, 2012 02:32

Hello!
Thanks for your efforts!

I ment it as you understood it. pvpython is working. I seemed like pvpython has imported the paraview library but when I type in the pyFoamPVSnapshot command with or without pvpython I get the same error again.

Maybe paraview python support is not enabled and that is the problem ... !

Greatings klio

gschaider October 23, 2012 17:38

Quote:

Originally Posted by klio (Post 388027)
Hello!
Thanks for your efforts!

I ment it as you understood it. pvpython is working. I seemed like pvpython has imported the paraview library but when I type in the pyFoamPVSnapshot command with or without pvpython I get the same error again.

Maybe paraview python support is not enabled and that is the problem ... !

I think in that case pvpython shouldn't even exist (and should be unable to import paraview). But check that: the Tools-menu in Paraview should have an entry "Python Shell". If not then it seems like your paraview is without Python-support (the "official" OF-Paraview usually is without Python)

klio October 24, 2012 04:11

I have no PythonSell and with the command paraview --script=sript.py it opens paraview but says "no python support" in the output message.

Also when i type paraview in a schell where pyFoam and OpenFoam is activated It opens another version than in an other shell.

I tried to confugure paraView (which OF uses) with ccmake to enable python. Now in the configfile the PARAVIEW_ENABLE_PYTHON is ON and also in the other files but I stil get the same output message from paraview. (I also compiled it agian but nothing changed).

I think maybe the pvpython command works because of the other paraview which is installed on the system and has nothing to do with the OF and pyFoam installation. but also the config there has the PYTHON variable ON.

gschaider October 24, 2012 09:20

Quote:

Originally Posted by klio (Post 388243)
I have no PythonSell and with the command paraview --script=sript.py it opens paraview but says "no python support" in the output message.

Yes, you have python shell. Just enter "python" and you will end up in a command line where you can enter stuff like

import paraview

BTW: afterwards try

print paraview

to see which library is actually used (same applies for pvpython)

But it seems that you have no python-support in Paraview

Quote:

Originally Posted by klio (Post 388243)
Also when i type paraview in a schell where pyFoam and OpenFoam is activated It opens another version than in an other shell.

I tried to confugure paraView (which OF uses) with ccmake to enable python. Now in the configfile the PARAVIEW_ENABLE_PYTHON is ON and also in the other files but I stil get the same output message from paraview. (I also compiled it agian but nothing changed).

I think maybe the pvpython command works because of the other paraview which is installed on the system and has nothing to do with the OF and pyFoam installation. but also the config there has the PYTHON variable ON.

Sounds like the paraview-variant of DLL-hell: when two versions of paraview are installed (usually one by the package-manager, one by whatever way you installed OF)

Have no idea except to check the environmentvariables PATH, LD_LIBRARY_PATH, PYTHONPATH and make sure that the "pythony" paraview comes first. Also check the environment variable starting with PV and PARA (there may not necessarily be some). The most radical method may be to get rid of one of the Paraview-versions and trying to get the other one to work

unnikrsn November 2, 2012 09:29

Dear gschaider

I am facing the same problems as Klio.

I have read and followed all the procedure here and other place for installing/Compiling Paraview with Python.
1. I had able to load a python file from my paraview and get a output.
2. I am not able to use the Python ( pypython ) to create snapshots using pyFoamPVSnapShot.py

atmoun@balder:/mnt/N/_AUTOMATISATION/Unni_save_dir/atmoun/Particle_image_velocimetry/PIV_Modell_Zylinder_perpendicularCylinders$ pvpython
Python 2.6.5 (r265:79063, Oct 1 2012, 22:16:31)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
^
SyntaxError: invalid syntax
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
^
SyntaxError: invalid syntax
>>> print paraview
<module 'paraview' from '/home/atmoun/OpenFOAM/ThirdParty-2.1.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/site-packages/paraview/__init__.pyc'>
>>>

Kindly help me.

Thanks & Regards
Unnikrishnan.


gschaider November 20, 2012 20:32

Quote:

Originally Posted by unnikrsn (Post 389874)
Dear gschaider

I am facing the same problems as Klio.

I have read and followed all the procedure here and other place for installing/Compiling Paraview with Python.
1. I had able to load a python file from my paraview and get a output.
2. I am not able to use the Python ( pypython ) to create snapshots using pyFoamPVSnapShot.py

atmoun@balder:/mnt/N/_AUTOMATISATION/Unni_save_dir/atmoun/Particle_image_velocimetry/PIV_Modell_Zylinder_perpendicularCylinders$ pvpython
Python 2.6.5 (r265:79063, Oct 1 2012, 22:16:31)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
^
SyntaxError: invalid syntax
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
^
SyntaxError: invalid syntax
>>> print paraview
<module 'paraview' from '/home/atmoun/OpenFOAM/ThirdParty-2.1.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/site-packages/paraview/__init__.pyc'>
>>>

Kindly help me.

Thanks & Regards
Unnikrishnan.


I don't think it as the same problem as Klios. There the problem is that paraview is not correctly imported. In your case this works. What you do on the next line ("pvpython ...") can not be done on the python-shell. Try it on the regular shell and report what the error message is then

ZKW November 21, 2012 10:07

1 Attachment(s)
Dear gschaider,

Thanks for the reply,


Also I would like to inform, after the previous messages, i changed the OpenFoam version and a installation procedure a couple of times.. Just trying to find a solution by trial and error.


Checking pvpython is not working now.

atmoun@balder:~/Documents/Particle_image_velocimetry/ZKW_Multiregion-simpleFoam_cavity_PIV_Zylinder_Model_1$ pypython
No command 'pypython' found, did you mean:
Command 'pvpython' from package 'paraview' (universe)
Command 'cypython' from package 'cyphesis-cpp-clients' (universe)
pypython: command not found
atmoun@balder:~/Documents/Particle_image_velocimetry/ZKW_Multiregion-simpleFoam_cavity_PIV_Zylinder_Model_1$


Also i wanted to say:

1. Installation of OpenFOAM 2.1.1
as User(Non-root in my home directory)
As I have a version of OpenFOAM 2.0.1 already installed in my system by system admin.

I had to install a version of OpenFOAM 2.1.1 in my home directory.
/home/atmoun/OpenFOAM/OpenFOAM-2.1.x


2. Installation of python 2.7.3
Installed python 2.7.3 in my home directory at the following location.
/home/atmoun/OpenFOAM/Python-2.7.3

atmoun@balder:~/OpenFOAM$cd Python-2.7.3
atmoun@balder:~/OpenFOAM/Python-2.7.3$make clean
atmoun@balder:~/OpenFOAM/Python-2.7.3$./configure --prefix=/home/atmoun/OpenFOAM/Python-2.7.3
atmoun@balder:~/OpenFOAM/Python-2.7.3$make
atmoun@balder:~/OpenFOAM/Python-2.7.3$make install


Then run using:

/home/atmoun/OpenFOAM/Python-2.7.3
/bin/python

3. Compiling Paraview with Python
While Compiling paraview i had a problem

/home/atmoun/OpenFOAM/ThirdParty-2.1.x
./makeParaView
# Python support:
# note: script will try to determine the appropriate python library.
#
If it fails, specify the path using the PYTHON_LIBRARY variable

withPYTHON=true
PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"
# PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"

I cannot Find the libpython2.7.so.1.0 in my installation directory or in /opt/ or in /usr/lib*/, I think this is the root cause for all the problem.
But i am not sure. if someone can help me.. where i can find the above file.

I dont want to use
PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0" due to the admin rights. but still i am using the same to compile paraview.

4. Installing pyFoam
(as in http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html )
/home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7
atmoun@balder:~/OpenFOAM/linuxSrc/PyFoam-0.5.7$ python setup.py install --prefix=$HOME/OpenFOAM/PyFoam-0.5.7

atmoun@balder:~/OpenFOAM/linuxSrc/PyFoam-0.5.7$ echo "alias PF='export PYTHONPATH=/$HOME/OpenFOAM/Python-2.7.3/lib/python2.7/site-packages:$PYTHONPATH; export PATH=$HOME/OpenFOAM/Python-2.7.3/bin:$PATH'" >> $HOME/.bashrc

Also i am really confused in the above 2 lines..
when installing pyFoam
I get the following
Neither numpy nor Numeric python-package installed. Plotting won't work

export pythonpath to /home/atmoun/OpenFOAM/my_python


Results : If you or anyone can check and tell me, if i am doing some thing wrong with the procedure, Kindly please explain in detail.

Attached: Picture of my User directory with Installation location of OpenFOAM-2.1.1, Paraview3.12 in thirdParty


Thanks in advance for the help.

Thanks & Regards
Unnikrishnan.


wouter September 6, 2013 18:37

Dear All,
I experience similar problems with OpenFOAM2.2.x on Ubuntu13.04 (64bit) an I hope someone knows a solution because I want to print a lot of snapshots and I hoped pyFoam could help me.
I folowed this thread and collected all the data asked for. Please feel free to ask for additional information

best regards
wouter

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
    from PyFoam.Applications.PVSnapshot import PVSnapshot
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
    from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
    from paraview import servermanager
ImportError: No module named paraview

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamVersion.py
Machine info: Linux | wouter-desktop | 3.8.0-30-generic | #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 | x86_64 | x86_64

Python version: 2.7.4 (default, Jul  5 2013, 08:21:57)
[GCC 4.7.3]

PYTHONPATH: /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/Utilities/VTKPythonWrapping

Location of this utility: /usr/local/bin/pyFoamVersion.py

OpenFOAM (2, 2, 'x') of the installed versions ['2.2.x']

pyFoam-Version: 0.6.0

Path where PyFoam was found (PyFoam.__path__) is ['/usr/local/lib/python2.7/dist-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/wouter/.pyFoam/pyfoamrc'), ('directory', '/home/wouter/.pyFoam/pyfoamrc.d')]
Configuration files (used): []

Installed libraries:
Gnuplot              :  No      Not a problem. Version from ThirdParty is used
ply                  :  No      Not a problem. Version from ThirdParty is used
Numeric              :  No      Not supported anymore. No need to install it
numpy                :  Yes      version: 1.7.1
matplotlib          :  No      Only Gnuplot-plotting possible
psyco                :  No      Not a problem. Acceleration not possible
hotshot              :  Yes
profile              :  Yes
cProfile            :  Yes
PyQt4                :  Yes
PyQt4.Qwt5          :  No      Only an alternate plotting back-end
vtk                  :  Yes
Tkinter              :  No      Not a problem. Used for the old version of DisplayBlockmesh and some matplotlib-implementations
mercurial            :  No      Not a problem. Used for experimental case handling
nose                :  No      Only needed for running the unit-tests (developers only)
twisted              :  Yes      version: 12.3.0
pandas              :  No      Not yet used. Maybe handling of timelines will be reimplemented with it
scipy                :  No      Not yet used. Possibly use signal-fitting etc

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ which python
/usr/bin/python
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ which paraview
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/bin/paraview

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ icoFoam -version

Usage: icoFoam [OPTIONS]
options:
  -case <dir>      specify alternate case directory, default is the cwd
  -noFunctionObjects
                    do not execute functionObjects
  -parallel        run in parallel
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

Using: OpenFOAM-2.2.x (see www.OpenFOAM.org)
Build: 2.2.x-9f309353a479



--> FOAM FATAL ERROR:
Invalid option: -version


FOAM exiting

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pvpython
Python 2.7.4 (default, Jul  5 2013, 08:24:51)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
>>>

starting ParaFoam->tools-Python Shell
Code:

Python 2.7.4 (default, Jul  5 2013, 08:24:51)
[GCC 4.7.3] on linux2
>>> from paraview.simple import *
paraview version 3.12.0, Date: 2011-07-26

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ python
Python 2.7.4 (default, Jul  5 2013, 08:21:57)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named paraview
>>> print paraview
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'paraview' is not defined
>>>

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $PATH
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/bin:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/gperftools-svn/bin:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/bin:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/bin:/home/wouter/OpenFOAM/wouter-2.2.x/platforms/linux64GccDPDebug/bin:/home/wouter/OpenFOAM/site/2.2.x/platforms/linux64GccDPDebug/bin:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/bin:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/bin:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/wmake:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $LD_LIBRARY_PATH
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/gperftools-svn/lib:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/openmpi-1.6.3:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64GccDPDebug/lib/openmpi-1.6.3:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib64:/home/wouter/OpenFOAM/wouter-2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/site/2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/dummy
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $PYTHONPATH
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/Utilities/VTKPythonWrapping
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$


gschaider September 9, 2013 14:14

Quote:

Originally Posted by wouter (Post 450289)
Dear All,
I experience similar problems with OpenFOAM2.2.x on Ubuntu13.04 (64bit) an I hope someone knows a solution because I want to print a lot of snapshots and I hoped pyFoam could help me.
I folowed this thread and collected all the data asked for. Please feel free to ask for additional information

best regards
wouter

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
    from PyFoam.Applications.PVSnapshot import PVSnapshot
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
    from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
    from paraview import servermanager
ImportError: No module named paraview


That's strange because pvpython knew the paraview module (thanks for the diagnosis output BTW). Now I have a big suspicion. Check how the file /usr/local/bin/pyFoamPVSnapshot.py looks like. At my machine it looks like this
Code:

#! /usr/bin/env pvpython


from PyFoam.Applications.PVSnapshot import PVSnapshot

PVSnapshot()

You installed with setup.py right? I think it may be possible that this replaces the pvpython in the first line with python. If that is the case replace it with pvpython and retry. If that fixes it I'd be grateful for a bug-report on the Mantis (so that I get around to fixing it. My problem is that I rarely install with setup.py so I stumbled onto this problem some time ago and forgot to fix it permanently)

wouter September 9, 2013 17:39

Dear gschaider,
Thank you for responding. You were right with your assumption. I changed the header and I got a different error
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=test.pvsm --time=10 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x152def0): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x3790960)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x152def0): Aborting execution for debugging purposes.

Aborted (core dumped)

There was no core dump. As far as I know I downloaded the latest version of pyFoam so I have to make two bug reports?
one for the header and one for the older version. I will look up how to make a bugreport.
Thanks again.

Best regards
Wouter

I found that this is already in a bugreport of 2009

gschaider September 9, 2013 18:28

Quote:

Originally Posted by wouter (Post 450785)
Dear gschaider,
Thank you for responding. You were right with your assumption. I changed the header and I got a different error
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=test.pvsm --time=10 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x152def0): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x3790960)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x152def0): Aborting execution for debugging purposes.

Aborted (core dumped)

There was no core dump. As far as I know I downloaded the latest version of pyFoam so I have to make two bug reports?
one for the header and one for the older version. I will look up how to make a bugreport.
Thanks again.

... and one for the misspelling of utility in the warning ;)

I just tried PVSnapshot on my machine and it works. I use a Kitware-Binary PV 3.98.1 (so it is unlikely that your 3.12 broke i) with a state-file that has a file for the built-in reader (.foam). Are you by any chance using the PV3Reader (.OpenFOAM)? If yes: could you try a simple state file using a .foam-file?

For a bug report I'll need the state-file and a case (preferably small) to reproduce the error

wouter September 10, 2013 07:49

1 Attachment(s)
Dear gschaider,
Thank you for responding. Attached a casefile for testing. I tried with paraFoam -builtin to make the .pvsm file but this does not change anything.
Is this what you meant with with simple state. I had .Openfoam and I got .foam but after pyFoamPVSnapshot.py I had Openfoam also.
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraFoam -builtin
created temporary 'testje.foam'
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.pvsm
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x27a1f60): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x4817490)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x27a1f60): Aborting execution for debugging purposes.

Aborted (core dumped)
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.foam  testje.OpenFOAM  testje.pvsm

hope this helps
Regards
Wouter

gschaider September 10, 2013 08:18

1 Attachment(s)
Thanks for the test case and bad news (see below; just building up the suspense):
Quote:

Originally Posted by wouter (Post 450913)
Dear gschaider,
Thank you for responding. Attached a casefile for testing. I tried with paraFoam -builtin to make the .pvsm file but this does not change anything.
Is this what you meant with with simple state. I had .Openfoam and I got .foam but after pyFoamPVSnapshot.py I had Openfoam also.
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraFoam -builtin
created temporary 'testje.foam'
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.pvsm
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x27a1f60): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x4817490)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x27a1f60): Aborting execution for debugging purposes.

Aborted (core dumped)
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.foam  testje.OpenFOAM  testje.pvsm

hope this helps
Regards
Wouter

The Bad News is that it works for me without problems (see attached image as proof). The image was done with a precompiled ParaView3.98.1 on a Mac (so that is as different from your configuration as it could get). I'm pretty sure that I didn't change anything to the Paraview-code since the last release of PyFoam (and my logs support me in that)
Attachment 25268
So I'm afraid this is a problem with Paraview. Try the following:
- Try loading the state file with "Load state" from the menue
- Try a different version binary of Paraview from KitWare
and see if you get a similar error message

wouter September 10, 2013 08:35

Dear gschaider,
Thank you for the information. I will try to install paraview but I have some bad experiences with that on an other computer.
It will take a will
I wil get back with the results
Regards
Wouter

gschaider September 10, 2013 17:45

Quote:

Originally Posted by wouter (Post 450928)
Dear gschaider,
Thank you for the information. I will try to install paraview but I have some bad experiences with that on an other computer.
It will take a will
I wil get back with the results

Good. I'm afraid the issue is outside of my control but I'm willing to find a workaround. One last thing: try the "official" way to load a state-file in pvpython http://paraview.org/Wiki/ParaView/Py...anipulating_It
If that fails then there is a problem with your paraview I'd say

wouter September 11, 2013 04:56

Dear gschaider,
Thank you for the persistance. This evening I certainly will try this. I can load the statefile with paraview --state=testje.pvsm. but I did not try it with pvpython. Thanks for the link.

Best regards
Wouter


All times are GMT -4. The time now is 14:51.