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

Problems with PyFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 8, 2013, 16:46
Default
  #21
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,107
Rep Power: 30
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: 9
Rep Power: 2
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,107
Rep Power: 30
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: 9
Rep Power: 2
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,107
Rep Power: 30
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 (Problems with PyFoam 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: 9
Rep Power: 2
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,107
Rep Power: 30
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

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
pyFoam and paraview eelcovv OpenFOAM 15 September 17, 2012 19:21
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 0 August 5, 2011 16:02
pyFoam, pyFlu, extend: How does they relate? Horus OpenFOAM 9 May 21, 2011 12:49
pyFoam batch set up for OF 1.7 eelcovv OpenFOAM Running, Solving & CFD 3 January 19, 2011 08:38
pyFoam setting is not correct? or not compatible with 1.6? seasoul OpenFOAM 2 March 23, 2010 12:42


All times are GMT -4. The time now is 20:45.