CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation

Problems with installing PyFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 8, 2013, 16:46
Default
  #21
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by simone.rowing View Post
dear geschaider, after a bit of fiddling with the folders, we have the PyQt4 installed and able to import it in python. the vtk package must also be installed, however it shows the following erro after runnung the code "pyFoamVersion.py"
Code:
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
/Applications/Paraview_3.98.1.app/Contents/Python/numpy/random/__init__.py:87: RuntimeWarning: compiletime version 2.6 of module 'mtrand' does not match runtime version 2.7
  from mtrand import *
numpy                :  Yes      version: 1.6.2
matplotlib           :  Yes      version: 1.1.1
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                  :  Error: Could not import vtkCommonComputationalGeometryPython
No      Not a problem. Only used for some utilities
Tkinter              :  Yes      version: $Revision: 81008 $
mercurial            :  No      Not a problem. Used for experimental case handling
nose                 :  No      Only needed for running the unit-tests (developers only)
twisted              :  Yes      version: 11.0.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
not entirely sure what to do next, many thanks for the help so far.
Please always poste the complete output of the utility and let me judge what is needed. As far as I can see you still got the Paraview-binaries in the PYTHONPATH. At the very least this breaks numpy (because you use Python 2.7, Paraview 2.6). Not sure, but this probably also breaks VTK.

So remove all parts pointing to the Paraview-installation from the PYTHONPATH and retry
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 8, 2013, 17:13
Default
  #22
New Member
 
Simone Martini
Join Date: Apr 2013
Posts: 10
Rep Power: 4
simone.rowing is on a distinguished road
Ok, I do in this way:
run Python
import sys
print sys.path
import paraview
import vtk

Code:
MacBook-di-Simone:~ simomartini$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sis
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sis' is not defined
>>> quit()
MacBook-di-Simone:~ simomartini$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/Users/simomartini', '/Applications/Paraview_3.98.1.app/Contents/Python', '/Applications/Paraview_3.98.1.app/Contents/Python/paraview', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
>>> import paraview
>>> import vtk
Error: Could not import vtkCommonComputationalGeometryPython
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Applications/Paraview_3.98.1.app/Contents/Python/paraview/vtk/__init__.py", line 7, in <module>
    from vtkCommonCorePython import *
ImportError: No module named vtkCommonCorePython
>>>
and this in my pyFoamVersion.py
Code:
MacBook-di-Simone:~ simomartini$ pyFoamVersion.py
Machine info: Darwin | MacBook-di-Simone.local | 11.4.2 | Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 | x86_64 | i386

Python version: 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

PYTHONPATH: :/Applications/Paraview_3.98.1.app/Contents/Python:/Applications/Paraview_3.98.1.app/Contents/Python/paraview

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

OpenFOAM () of the installed versions ['2.2.0']
  This version of OpenFOAM uses the old calling convention

pyFoam-Version: 0.6.0

Path where PyFoam was found (PyFoam.__path__) is ['/Library/Python/2.7/site-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/Users/simomartini/.pyFoam/pyfoamrc'), ('directory', '/Users/simomartini/.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
/Applications/Paraview_3.98.1.app/Contents/Python/numpy/random/__init__.py:87: RuntimeWarning: compiletime version 2.6 of module 'mtrand' does not match runtime version 2.7
  from mtrand import *
numpy                :  Yes      version: 1.6.2
matplotlib           :  Yes      version: 1.1.1
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                  :  Error: Could not import vtkCommonComputationalGeometryPython
No      Not a problem. Only used for some utilities
Tkinter              :  Yes      version: $Revision: 81008 $
mercurial            :  No      Not a problem. Used for experimental case handling
nose                 :  No      Only needed for running the unit-tests (developers only)
twisted              :  Yes      version: 11.0.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
MacBook-di-Simone:~ simomartini$
simone.rowing is offline   Reply With Quote

Old   May 8, 2013, 17:32
Default
  #23
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by simone.rowing View Post
and this in my pyFoamVersion.py
Code:
MacBook-di-Simone:~ simomartini$ pyFoamVersion.py
Machine info: Darwin | MacBook-di-Simone.local | 11.4.2 | Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 | x86_64 | i386

Python version: 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

PYTHONPATH: :/Applications/Paraview_3.98.1.app/Contents/Python:/Applications/Paraview_3.98.1.app/Contents/Python/paraview
As I suspected: Paraview is in the PYTHONPATH. Completely erase the path with 'unset PYTHONPATH' and retry

The VTK-version that comes with Paraview is NO help. For some technical reason (you'll have to research that yourself) the version of VTK that comes with Paraview is modified and in parts behaves differently. Make sure you use the version from MacPorts (I think I described that before)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 8, 2013, 18:25
Default
  #24
New Member
 
Simone Martini
Join Date: Apr 2013
Posts: 10
Rep Power: 4
simone.rowing is on a distinguished road
this is my version of ports
Code:
MacBook-di-Simone:~ simomartini$ port
MacPorts 2.1.3
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/simomartini] >
the pyFoam doesn't recognize the vtk and the installation with port that you already suggested didn't work with python. Do you know another way to install vtk to work with pyFoam. I tried to use Homebrew but I have not had any success.
Code:
MacBook-di-Simone:~ simomartini$ pyFoamVersion.py
Machine info: Darwin | MacBook-di-Simone.local | 11.4.2 | Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 | x86_64 | i386

Python version: 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

PYTHONPATH: :/Users/simomartini/projects/ParaView-bin/lib/site-packages/

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

OpenFOAM () of the installed versions ['2.2.0']
  This version of OpenFOAM uses the old calling convention

pyFoam-Version: 0.6.0

Path where PyFoam was found (PyFoam.__path__) is ['/Library/Python/2.7/site-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/Users/simomartini/.pyFoam/pyfoamrc'), ('directory', '/Users/simomartini/.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.5.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                  :  No      Not a problem. Only used for some utilities
Tkinter              :  Yes      version: $Revision: 81008 $
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
simone.rowing is offline   Reply With Quote

Old   May 8, 2013, 18:44
Default
  #25
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by simone.rowing View Post
this is my version of ports
Code:
MacBook-di-Simone:~ simomartini$ port
MacPorts 2.1.3
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/simomartini] >
the pyFoam doesn't recognize the vtk and the installation with port that you already suggested didn't work with python. Do you know another way to install vtk to work with pyFoam. I tried to use Homebrew but I have not had any success.
I already explained it to you in a previous post (http://www.cfd-online.com/Forums/ope...l#post423691): install the vtk from MacPorts! I assumed you've already done that and the library was "shadowed" by the paraview-version
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 10, 2013, 05:35
Default
  #26
New Member
 
Simone Martini
Join Date: Apr 2013
Posts: 10
Rep Power: 4
simone.rowing is on a distinguished road
I already install the vtk5! but I really don't know why this doesn't work.

Code:
MacBook-di-Simone:~ simomartini$ sudo port install vtk5 +python27 +qt4_mac
Password:
--->  Computing dependencies for vtk5
--->  Deactivating vtk5 @5.10.1_0+tcltk+x11
--->  Cleaning vtk5
--->  Activating vtk5 @5.10.1_0+python27+qt4_mac
--->  Cleaning vtk5
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.
MacBook-di-Simone:~ simomartini$ pyFoamVersion.py
Machine info: Darwin | dhcp-201-211.wireless.soton.ac.uk | 11.4.2 | Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 | x86_64 | i386

Python version: 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

PYTHONPATH: :/Users/simomartini/projects/ParaView-bin/lib/site-packages/

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

OpenFOAM () of the installed versions ['2.2.0']
  This version of OpenFOAM uses the old calling convention

pyFoam-Version: 0.6.0

Path where PyFoam was found (PyFoam.__path__) is ['/Library/Python/2.7/site-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/Users/simomartini/.pyFoam/pyfoamrc'), ('directory', '/Users/simomartini/.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.5.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                  :  No      Not a problem. Only used for some utilities
Tkinter              :  Yes      version: $Revision: 81008 $
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
MacBook-di-Simone:~ simomartini$
simone.rowing is offline   Reply With Quote

Old   May 11, 2013, 06:17
Default
  #27
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by simone.rowing View Post
I already install the vtk5! but I really don't know why this doesn't work.

Code:
MacBook-di-Simone:~ simomartini$ sudo port install vtk5 +python27 +qt4_mac
Password:
--->  Computing dependencies for vtk5
--->  Deactivating vtk5 @5.10.1_0+tcltk+x11
--->  Cleaning vtk5
--->  Activating vtk5 @5.10.1_0+python27+qt4_mac
--->  Cleaning vtk5
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.
MacBook-di-Simone:~ simomartini$ pyFoamVersion.py
Machine info: Darwin | dhcp-201-211.wireless.soton.ac.uk | 11.4.2 | Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 | x86_64 | i386

Python version: 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

PYTHONPATH: :/Users/simomartini/projects/ParaView-bin/lib/site-packages/

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

OpenFOAM () of the installed versions ['2.2.0']
  This version of OpenFOAM uses the old calling convention

pyFoam-Version: 0.6.0

Path where PyFoam was found (PyFoam.__path__) is ['/Library/Python/2.7/site-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/Users/simomartini/.pyFoam/pyfoamrc'), ('directory', '/Users/simomartini/.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.5.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                  :  No      Not a problem. Only used for some utilities
Tkinter              :  Yes      version: $Revision: 81008 $
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
MacBook-di-Simone:~ simomartini$
Which python-version are you using? From the version reported I guess the apple-version in /usr/bin/python (but please verify with "which"). I use the MacPorts-version and the variant +python27 of vtk5 assumes that. Either select the MacPorts-version with "port select python python27" or reinstall vtk5 without that option (but I haven't tested that)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 7, 2014, 05:51
Default error messages running pyFoamPlotRunner
  #28
New Member
 
Join Date: Aug 2013
Posts: 6
Rep Power: 4
mmartin is on a distinguished road
hello

i installed pyFoam on a rhel server but if i run pyFoamPlotRunner

with the syntax

pyFoamPlotRunner.py <OFsolver> -case CASE

pyFoamPlotRunner.py <OFsolver> (in the case folder)


i get following error messageTraceback (most recent call last):
File "/usr/bin/pyFoamPlotRunner.py", line 3, in ?
from PyFoam.Applications.PlotRunner import PlotRunner
File "/usr/lib/python2.4/site-packages/PyFoam/Applications/PlotRunner.py", line 6
from .PyFoamApplication import PyFoamApplication
^
SyntaxError: invalid syntax



i would be happy about any help or recommendations

i m running pyFoam0.6.2
mmartin is offline   Reply With Quote

Old   May 7, 2014, 07:01
Default
  #29
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mmartin View Post
hello

i installed pyFoam on a rhel server but if i run pyFoamPlotRunner

with the syntax

pyFoamPlotRunner.py <OFsolver> -case CASE

pyFoamPlotRunner.py <OFsolver> (in the case folder)


i get following error messageTraceback (most recent call last):
File "/usr/bin/pyFoamPlotRunner.py", line 3, in ?
from PyFoam.Applications.PlotRunner import PlotRunner
File "/usr/lib/python2.4/site-packages/PyFoam/Applications/PlotRunner.py", line 6
from .PyFoamApplication import PyFoamApplication
^
SyntaxError: invalid syntax



i would be happy about any help or recommendations

i m running pyFoam0.6.2
At first: please add output in the CODE-tag (that's be the # in the toolbar above). It makes it much easier to spot where the ^ is actually pointing to.

What kind of RHEL? My guess is that it is not 6. Because the problem you have is one of the rare backward incompatibilities in Python. Relative imports were introduced with python 2.5 (so your Python seems to be 2.4 or older). Ah. Just saw it: it says 2.4 in the output

Options are:
- make the import absolute (just add PyFoam.Applications in front of the dot). Don't know where else this is required. Or make it "oldSchool"-relative by removing the dot in the front
- there are packages python26 or python27 for RHEL that give you a higher-version PyFoam in parallel to the system on (don't EVER replace the system-python on a RHEL-machine). Using that needs a little bit of trickery (especially if you use setup.py)

The reason why PyFoam uses the new-style relative import is that the old way does not work with Python 3 (PyFoam is compatible with python 2.x and 3.x but in order to get that I had to break compatibility with Pythons older than 2.5)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 7, 2014, 07:20
Default
  #30
New Member
 
Join Date: Aug 2013
Posts: 6
Rep Power: 4
mmartin is on a distinguished road
oh sorry i didnt knew that

Code:
File "/usr/bin/pyFoamPlotRunner.py", line 3, in ?
    from PyFoam.Applications.PlotRunner import PlotRunner
  File "/usr/lib/python2.4/site-packages/PyFoam/Applications/PlotRunner.py", line 6
    from .PyFoamApplication import PyFoamApplication
         ^
SyntaxError: invalid syntax
its RHEL 5.10. I already sent your advices to our admin (i m not root)
mmartin is offline   Reply With Quote

Old   May 8, 2014, 04:35
Default
  #31
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mmartin View Post
oh sorry i didnt knew that

Code:
File "/usr/bin/pyFoamPlotRunner.py", line 3, in ?
    from PyFoam.Applications.PlotRunner import PlotRunner
  File "/usr/lib/python2.4/site-packages/PyFoam/Applications/PlotRunner.py", line 6
    from .PyFoamApplication import PyFoamApplication
         ^
SyntaxError: invalid syntax
its RHEL 5.10. I already sent your advices to our admin (i m not root)
OK. Recommended is installing a python26/27 binary package and virtualenv. Then create a virtual environment in which you install dependencies. That leaves the system-python clean and allows you to use bleeding-edge versions of the python-packages (if your sysadmin is nice he does this for you). I use a similar setup here (CentOS6 is a LITTLE more advanced than your 5 but for fast-moving libraries like Pandas or Matlab it is hopelessly outdated)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   October 19, 2015, 15:23
Default pyFoamDisplayBlockMesh.py raise e AttributeError: SetInput
  #32
New Member
 
Join Date: Feb 2010
Posts: 28
Rep Power: 7
Pekka is on a distinguished road
Hi,

I have a similar problem as is reported earlier and I can not find solution to that. My os is rhel 7.1 and same problem occur with pyFoam version 0.6.1 and 0.6.4. Error message is also similar with both pyFoam version.

error:
Code:
[Pekka@Kone4 rotor]$ pyFoamDisplayBlockMesh.py constant/polyMesh/blockMeshDict 
Using system-VTK
Status: blockMesh modified - Ready
 PyFoam WARNING on line 338 of file /home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/DisplayBlockMeshQt.py : While reading constant/polyMesh/blockMeshDict this happened: SetInput 
Traceback (most recent call last):
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/bin/pyFoamDisplayBlockMesh.py", line 18, in <module>
    DisplayBlockMesh()
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/DisplayBlockMeshQt.py", line 1338, in __init__
    nr=1)
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/PyFoamApplicationQt4.py", line 37, in __init__
    exactNr=exactNr)
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/PyFoamApplication.py", line 356, in __init__
    result=self.run()
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/PyFoamApplicationQt4.py", line 59, in run
    self.setupGUI()
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/DisplayBlockMeshQt.py", line 1369, in setupGUI
    valuesFile=self.opts.valuesFile)
  File "/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/Applications/DisplayBlockMeshQt.py", line 339, in __init__
    raise e
AttributeError: SetInput
and

Code:
[Pekka@Kone4 rotor]$ pyFoamVersion.py 
Machine info: Linux | Kone4 | 3.10.0-229.14.1.el7.x86_64 | #1 SMP Tue Sep 15 15:05:51 UTC 2015 | x86_64 | x86_64

Python version: 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]

Python executable: /usr/bin/python

Python 2.7 is one development platform for PyFoam (along with Python 3)
PYTHONPATH: /home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages:

Location of this utility: /home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/bin/pyFoamVersion.py

 PyFoam WARNING on line 192 of file /home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam/FoamInformation.py : Basedir /home/Pekka/OpenFOAM for fork openfoam does not exist or is not a directory 
Version 3.2 Fork extend of the installed 2 versions:
extend-3.1 : /home/Pekka/foam/foam-extend-3.1
extend-3.2 : /home/Pekka/foam/foam-extend-3.2

pyFoam-Version: 0.6.4
ALERT: Reported version (0, 6, 4) is different from hardcoded version (0, 6, 4, 'development') -> probably inconsistent library installation

Path where PyFoam was found (PyFoam.__path__) is ['/home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch/lib/python2.7/site-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/Pekka/foam/foam-extend-3.2/ThirdParty/PyFoamSiteScripts/etc/pyfoamrc'), ('directory', '/home/Pekka/foam/foam-extend-3.2/ThirdParty/PyFoamSiteScripts/etc/pyfoamrc.d'), ('file', '/home/Pekka/.pyFoam/pyfoamrc'), ('directory', '/home/Pekka/.pyFoam/pyfoamrc.d')]
Configuration files (used): ['/home/Pekka/.pyFoam/pyfoamrc']

Installed libraries:
cython               :  No      Not used. Maybe will by used later to spped up parts of PyFoam 
cProfile             :  Yes 
docutils             :  No      Not necessary. Needed for RestructuredText to HTML conversion 
Gnuplot              :  No      Not a problem. Version from ThirdParty is used 
hotshot              :  Yes 
ipdb                 :  No      Not necessary. Only makes debugging more comfortable 
IPython              :  No      Not necessary. But the interactive shell may be more comfortable 
matplotlib           :  Yes      version: 1.2.0 
mercurial            :  Yes      version: 2.6.2 
nose                 :  Yes      version: 1.3.0 
numpy                :  Yes      version: 1.7.1 
openpyxl             :  No      Not a problem. Only used for exporting pandas-data to Excel-files (advanced) 
pandas               :  No      Not a problem. Only used for handling of advanced data-handling 
ply                  :  No      Not a problem. Version from ThirdParty is used 
profile              :  Yes 
psyco                :  No      Not a problem. Acceleration not possible 
PyQt4                :  Yes      version: 4.8.5 
PyQt4.Qwt5           :  No      Only an alternate plotting back-end 
scipy                :  No      Not yet used. Possibly use signal-fitting etc 
Tkinter              :  Yes      version: $Revision: 81008 $ 
twisted              :  No      Not yet used. Possibly reimplement MetaServer with it 
vtk                  :  Yes      version: 6.1.0 
xlwt                 :  No      Not a problem. Only used for exporting pandas-data to Excel-files 
xlrd                 :  No      Not a problem. Only used for importing Excel-files to pandas-data 

Library locations
cProfile             : /usr/lib64/python2.7/cProfile.pyc
hotshot              : /usr/lib64/python2.7/hotshot/__init__.pyc
matplotlib           : /usr/lib64/python2.7/site-packages/matplotlib/__init__.pyc
mercurial            : /usr/lib64/python2.7/site-packages/mercurial/__init__.pyc
nose                 : /usr/lib/python2.7/site-packages/nose/__init__.pyc
numpy                : /usr/lib64/python2.7/site-packages/numpy/__init__.pyc
profile              : /usr/lib64/python2.7/profile.pyc
PyQt4                : /usr/lib64/python2.7/site-packages/PyQt4/__init__.pyc
Tkinter              : /usr/lib64/python2.7/lib-tk/Tkinter.pyc
vtk                  : /usr/lib64/python2.7/site-packages/vtk/__init__.pyc

Checking additional envirnoment variables

Checking for PYFOAM_DIR : Location of the PyFoam-installation. Not strictly necessary
PYFOAM_DIR set to /home/Pekka/foam/foam-extend-3.2/ThirdParty/packages/PyFoam-0.6.4/platforms/noarch

Checking for PYFOAM_SITE_DIR : Location of non-PyFoam-disctributions script. Set and used by some Foam-distributions
PYFOAM_SITE_DIR set to /home/Pekka/foam/foam-extend-3.2/ThirdParty/PyFoamSiteScripts
Site-specific scripts should be added to /home/Pekka/foam/foam-extend-3.2/ThirdParty/PyFoamSiteScripts/bin
Site-specific configurations can be added to /home/Pekka/foam/foam-extend-3.2/ThirdParty/PyFoamSiteScripts/etc
Site-specific library files can be added to /home/Pekka/foam/foam-extend-3.2/ThirdParty/PyFoamSiteScripts/lib Do NOT add to PYTHONPATH but import as PyFoam.Site
[Pekka@Kone4 rotor]$
and

older pyFoam version

Code:
[Pekka@Kone4 angledDuctExplicit]$ pyFoamVersion.py 
Machine info: Linux | Kone4 | 3.10.0-229.14.1.el7.x86_64 | #1 SMP Tue Sep 15 15:05:51 UTC 2015 | x86_64 | x86_64

Python version: 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]

Python executable: /usr/bin/python

PYTHONPATH: /home/Pekka/foam/foam-extend-3.1/ThirdParty/packages/PyFoam-0.6.1/platforms/noarch/lib/python2.7/site-packages:

Location of this utility: /home/Pekka/foam/foam-extend-3.1/ThirdParty/packages/PyFoam-0.6.1/platforms/noarch/bin/pyFoamVersion.py

OpenFOAM (3, 1) of the installed versions []

pyFoam-Version: 0.6.1

Path where PyFoam was found (PyFoam.__path__) is ['/home/Pekka/foam/foam-extend-3.1/ThirdParty/packages/PyFoam-0.6.1/platforms/noarch/lib/python2.7/site-packages/PyFoam']

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

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           :  Yes      version: 1.2.0 
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              :  Yes      version: $Revision: 81008 $ 
mercurial            :  Yes 
nose                 :  Yes      version: 1.3.0 
twisted              :  No      Not yet used. Possibly reimplement MetaServer with it 
pandas               :  No      Not yet used. Maybe handling of timelines will be reimplemented with it 
scipy                :  No      Not yet used. Possibly use signal-fitting etc 

Library locations
profile              : /usr/lib64/python2.7/profile.pyc
Tkinter              : /usr/lib64/python2.7/lib-tk/Tkinter.pyc
hotshot              : /usr/lib64/python2.7/hotshot/__init__.pyc
mercurial            : /usr/lib64/python2.7/site-packages/mercurial/__init__.pyc
vtk                  : /usr/lib64/python2.7/site-packages/vtk/__init__.pyc
matplotlib           : /usr/lib64/python2.7/site-packages/matplotlib/__init__.pyc
PyQt4                : /usr/lib64/python2.7/site-packages/PyQt4/__init__.pyc
nose                 : /usr/lib/python2.7/site-packages/nose/__init__.pyc
cProfile             : /usr/lib64/python2.7/cProfile.pyc
numpy                : /usr/lib64/python2.7/site-packages/numpy/__init__.pyc
[Pekka@Kone4 angledDuctExplicit]$
Thanks in advance
BR/Pekka
Pekka is offline   Reply With Quote

Old   October 24, 2015, 17:55
Default
  #33
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,219
Blog Entries: 35
Rep Power: 94
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quick answer @Pekka: VTK 6.1... I don't think that PyFoam is prepared for VTK 6.x, because the API changed considerably between VTK 5.x to 6.x.

How exactly did you install Qt 4.8 and VTK 6.1 in RHEL 7? Was it from the EPEL repositories?
wyldckat is offline   Reply With Quote

Old   October 29, 2015, 15:34
Default
  #34
New Member
 
Join Date: Feb 2010
Posts: 28
Rep Power: 7
Pekka is on a distinguished road
Thank you Bruno!

Problem has been solved by downgrade vtk to older one. I compiled vtk-5.10.1-4 from fc19.src.rpm source package. vtk 6.1.0 is from epel repository.

BR/Pekka
wyldckat likes this.
Pekka is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems installing foam-extend 3.0 aylalisa OpenFOAM Installation 9 April 23, 2015 16:17
pyFoam problems Tobi OpenFOAM Post-Processing 5 December 2, 2014 09:13
Installing OpenFOAM141patched on Solaris10 MPIProblem jfb OpenFOAM Installation 1 October 24, 2007 08:05
Installation problems shellbell1999 OpenFOAM Installation 9 April 6, 2006 13:29
Problems installing CFX on Sun Unix Platform Haley CFX 2 November 9, 2001 10:52


All times are GMT -4. The time now is 03:32.