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

pyFoam error

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 5, 2012, 15:48
Default pyFoam error
  #1
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 355
Rep Power: 11
cnsidero is on a distinguished road
Oh where oh where art thou Bernhard ...

Having some trouble with pyFoam since upgrading from v0.5.4 to 0.5.7. When I run a pyFoam command, for example pyFoamClearCase.py, I get the following:
Code:
[user@computer case]$ pyFoamClearCase.py 
Traceback (most recent call last):
  File "/usr/bin/pyFoamClearCase.py", line 3, in <module>
    from PyFoam.Applications.ClearCase import ClearCase
  File "/usr/lib/python2.6/site-packages/PyFoam/Applications/ClearCase.py", line 6, in <module>
    from PyFoamApplication import PyFoamApplication
  File "/usr/lib/python2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 8, in <module>
    from PyFoam.Error import error,warning,FatalErrorPyFoamException
ImportError: cannot import name FatalErrorPyFoamException
I am sure the error is between the keyboard and chair but I'm not sure where to start. I installed it as root. I didn't know how to remove/uninstall v0.5.4 so I installed v0.5.7 over top (perhaps that's the issue). Let me, if/what additional info you need.

Last edited by cnsidero; June 6, 2012 at 09:14.
cnsidero is offline   Reply With Quote

Old   June 5, 2012, 18:43
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,862
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by cnsidero View Post
Oh where oh where art thou Bernard ...
Sounds like a Cohen-brothers movie to me. Given the mortality of the major figures in these movies I'm not too keen to see THAT particular movie

Quote:
Originally Posted by cnsidero View Post
Having some trouble with pyFoam since upgrading from v0.5.4 to 0.5.7. When I run a pyFoam command, for example pyFoamClearCase.py, I get the following:
Code:
[user@computer case]$ pyFoamClearCase.py 
Traceback (most recent call last):
  File "/usr/bin/pyFoamClearCase.py", line 3, in <module>
    from PyFoam.Applications.ClearCase import ClearCase
  File "/usr/lib/python2.6/site-packages/PyFoam/Applications/ClearCase.py", line 6, in <module>
    from PyFoamApplication import PyFoamApplication
  File "/usr/lib/python2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 8, in <module>
    from PyFoam.Error import error,warning,FatalErrorPyFoamException
ImportError: cannot import name FatalErrorPyFoamException
I am sure the error is between the keyboard and chair but I'm not sure where to start. I installed it as root. I didn't know how to remove/uninstall v0.5.4 so I installed v0.5.7 over top (perhaps that's the issue). Let me, if/what additional info you need.
Yes. FatalErrorPyFoamException was introduced in 0.5.5 so my guess is that at least PyFoam/Error.py is from the old version. Maybe also libraries from two different places are used. To check from where a library is imported go to the python shell with "python". There do

import PyFoam.Error
print PyFoam.Error

that should be in /usr/lib/python2.6/site-packages/ otherwise the "two-libraries"-theory applies.

Otherwise the cleanest way would be to remove the whole directory /usr/lib/python2.6/site-packages/PyFoam/ and reinstall (also removing /usr/bin/pyFoam* can't be a bad idea ... before reinstalling of course)

One way to avoid such problems in the future is to use the package manager of your distro to install and upgrade pyFoam. "make rpm" and "make dpkg" make packages for the two most popular package managers. For the rpm-variant you don't need additional software. dpkg needs a buch of Debian packaging tools but I don't know which (I don't have a Ubuntu/Debian system)
gschaider is offline   Reply With Quote

Old   June 6, 2012, 09:13
Default
  #3
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 355
Rep Power: 11
cnsidero is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Sounds like a Cohen-brothers movie to me. Given the mortality of the major figures in these movies I'm not too keen to see THAT particular movie
Love Cohen-brothers movies ;-).

Quote:
Yes. FatalErrorPyFoamException was introduced in 0.5.5 so my guess is that at least PyFoam/Error.py is from the old version.
That was probably it.

Quote:
One way to avoid such problems in the future is to use the package manager of your distro to install and upgrade pyFoam. "make rpm" and "make dpkg" make packages for the two most popular package managers. For the rpm-variant you don't need additional software. dpkg needs a buch of Debian packaging tools but I don't know which (I don't have a Ubuntu/Debian system)
There is no makefile in the tarball. This did the trick for building the rpm:
Code:
$>python setup.py bdist_rpm
Once I removed everything and reinstalled, all good. Thanks for the help!
cnsidero is offline   Reply With Quote

Old   June 6, 2012, 15:46
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,862
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by cnsidero View Post
Love Cohen-brothers movies ;-).



That was probably it.


There is no makefile in the tarball. This did the trick for building the rpm:
Code:
$>python setup.py bdist_rpm
Once I removed everything and reinstalled, all good. Thanks for the help!
Ah. Yeah. The Makefile is in the SVN repository (http://openfoamwiki.net/index.php/Co...oam#Subversion). From which the tarball was produced with setup.py. Which doesn't include the Makefile. I should look at the tarballs more often
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
GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM 300 October 29, 2014 20:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43
Saving ParaFoam views and case sail OpenFOAM Paraview & paraFoam 9 November 25, 2011 16:46
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
user defined function cfduser CFX 0 April 29, 2006 11:58


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