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 .... |
Quote:
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 |
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! |
Quote:
Quote:
If "normal" pvpython works (but you're terribly unclear there) try calling the script with pvpython <fullPathToScript>/pyFoamPVSnapShot.py <your parameters> |
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 |
Quote:
|
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. |
Quote:
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:
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 |
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. |
Quote:
|
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. |
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 Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamVersion.py Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ which python Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ icoFoam -version Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pvpython Code:
Python 2.7.4 (default, Jul 5 2013, 08:24:51) Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ python Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $PATH |
Quote:
Code:
#! /usr/bin/env pvpython |
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 . 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 |
Quote:
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 |
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 Regards Wouter |
1 Attachment(s)
Thanks for the test case and bad news (see below; just building up the suspense):
Quote:
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 |
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 |
Quote:
If that fails then there is a problem with your paraview I'd say |
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 |
2 Attachment(s)
Dear gschaider,
Yesterday I tried things and tonight I continued. first test Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraview --state=testje.pvsm Second test with OF221 debian binary and paraviewopenfoam debian binary Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.1/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 . Back to OF22x from paraView see picture (it works) Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pvpython The next core dump I missed the cause of and I cannot reproduce it, but maybe it helps Code:
XIO: fatal IO error 0 (Success) on X server ":0" Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=1 . Is there an easy way to use the system paraview3.98-python with openfoam 2.2.x? My attempt to build paraview3.98 and use it in openfoam failed because of missing headerfiles or headerfiles in the wrong places. any help is appreciated. best regards wouter |
Quote:
Quote:
Quote:
Quote:
If you still want to find the problem in pyFoam then the next thing would be to sprinkle the code with print-statements to see which call breaks everything (as the PV-libraries cause a core-dump there is no stack-trace). One candidate would be before and after Code:
sm.LoadState(newState) |
Hello gschaider,
Thanks again for your commitment to pyFoam. I will try to follow the program and see where the interface has problems. It will take a while because my python knowledge is minimal. Best regards wouter |
Quote:
Code:
print "I'm before ReadState" Sorry to offload debugging to you but it'd take me to long to reproduce the environment you have |
Hello gschaider,
As I wrote, my knoledge of Python is minimal. Can you tell me where I can find the module PVSnapshot.py that is called, or do I have to "compile" with setup.py best regards wouter edit: I found it in usr/local/lib/python2.7/dist-packages/PyFoam/Applications. I also found that it goes wrong at calling SM(PV3FoamReader) |
1 Attachment(s)
Quote:
Attachment 25324 |
Hello gschaider,
what do I do with this file? I cannot find this file on my system and I do know to little of python to know where to put this file. Regards Wouter Edit: found it (typo in find). It is the same as you sent me (diff gave only header difference) so I go on with print and report back, but not tonight anymore. |
1 Attachment(s)
Hello gschaider,
succes. Code:
print "in __init__ ServermanagerWrapper.py" #added by wouter Thank you for the patience Code:
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=2 . >log.PVSS edit2: in ServermanagerWrapper.py I replaced libPV3FoamReader.so into libvtkPV3Reader.so and the error message disappeared except for the Inconsistency. Still I get the pictures I want. I get the last error or warning also if I use paraview. Best regards wouter |
Quote:
Quote:
|
Hello gschaider,
The 'fix' was still in place. Because of the fix the program worked but there was still an error. I looked for it and found that the library called was not available and I replaced it with one that was available in PV3FoamReader directory. The last error has something to do with my Thirdparty paraview, because if I only use paraview this error occures, not with paraFoam and not with /usr/bin/paraview. I tried to rebuild it but the error remained. Best Regards Wouter |
Quote:
|
All times are GMT -4. The time now is 23:30. |