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

[PyFoam] Problems with the new PyFoam release

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2014, 13:38
Default Problems with the new PyFoam release
  #1
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Hello,

I saw some days ago that a new version of PyFoam was released. I used to have version 0.6.2 but I wanted to try one of its new features so I updated my PyFoam directory by typing on the terminal svn up. The update process seemed to work well. After that I typed sudo python setup.py install to install it again with the new features. I don't know if this is the correct procedure or if I missed some step...

The point is that all the utilities that have been updated or added during the process don't work, but the ones that haven't been modified work normally.

This is the message that shows the terminal when I execute one of the new/updated utilities (pyFoamPrepareCase):
Code:
Traceback (most recent call last):
  File "/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/bin/pyFoamPrepareCase.py", line 3, in <module>
    from PyFoam.Applications.PrepareCase import PrepareCase
ImportError: No module named PrepareCase
I would like to know what I should do to make it work properly. I'm not much used to update repositories so a good explanation will be very welcome.


Thanks in advance,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 4, 2014, 16:22
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
Hello,

I saw some days ago that a new version of PyFoam was released. I used to have version 0.6.2 but I wanted to try one of its new features so I updated my PyFoam directory by typing on the terminal svn up. The update process seemed to work well. After that I typed sudo python setup.py install to install it again with the new features. I don't know if this is the correct procedure or if I missed some step...

The point is that all the utilities that have been updated or added during the process don't work, but the ones that haven't been modified work normally.

This is the message that shows the terminal when I execute one of the new/updated utilities (pyFoamPrepareCase):
Code:
Traceback (most recent call last):
  File "/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/bin/pyFoamPrepareCase.py", line 3, in <module>
    from PyFoam.Applications.PrepareCase import PrepareCase
ImportError: No module named PrepareCase
I would like to know what I should do to make it work properly. I'm not much used to update repositories so a good explanation will be very welcome.


Thanks in advance,

Alex
If I interpret your output correctly there should be a file /home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/PyFoam/applications/PrepareCase.py

But before I start guessing (I checked: the file is in the SVN): output of pyFoamVersion.py please
__________________
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   December 4, 2014, 16:29
Default
  #3
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Output of pyFoamVersion.py:

Code:
Machine info: Linux | linux-cfd | 3.7.10-1.32-default | #1 SMP Thu May 8 00:09:34 UTC 2014 (5978d00) | x86_64 | x86_64

Python version: 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]

Python executable: /usr/bin/python

Python 2.7 is one development platform for PyFoam (along with Python 3)
PYTHONPATH: /home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:

Location of this utility: /home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/bin/pyFoamVersion.py

Traceback (most recent call last):
  File "/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/bin/pyFoamVersion.py", line 64, in <module>
    "Fork",PyFoam.FoamInformation.foamFork(),
AttributeError: 'module' object has no attribute 'foamFork'
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 4, 2014, 16:43
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
Output of pyFoamVersion.py:

Code:
Machine info: Linux | linux-cfd | 3.7.10-1.32-default | #1 SMP Thu May 8 00:09:34 UTC 2014 (5978d00) | x86_64 | x86_64

Python version: 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]

Python executable: /usr/bin/python

Python 2.7 is one development platform for PyFoam (along with Python 3)
PYTHONPATH: /home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages:

Location of this utility: /home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/bin/pyFoamVersion.py

Traceback (most recent call last):
  File "/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/bin/pyFoamVersion.py", line 64, in <module>
    "Fork",PyFoam.FoamInformation.foamFork(),
AttributeError: 'module' object has no attribute 'foamFork'
Seems like your libraries at /home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages are still at the old version (/home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages/PyFoam/__init__.py will probably still show version 0.6.2). Are you sure that setup.py installed them there?
__________________
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   December 4, 2014, 16:58
Default
  #5
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
This is how my "home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages/PyFoam/__init__.py" looks like:

Code:
#  ICE Revision: $Id: /local/openfoam/Python/PyFoam/PyFoam/__init__.py 8489 2013-11-03T19:15:58.198885Z bgschaid  $
""" Utility-classes for OpenFOAM

Module for the Execution of OpenFOAM-commands and processing their output
"""

from PyFoam.Infrastructure.Configuration import Configuration

def version():
    """@return: Version number as a tuple"""
    return (0,6,2)
    #    return (0,6,3,"development")

def versionString():
    """@return: Version number of PyFoam"""
    v=version()

    vStr="%d" % v[0]
    for d in v[1:]:
        if type(d)==int:
            vStr+=(".%d" % d)
        else:
            vStr+=("-%s" % str(d))
    return vStr

def foamVersionString():
    from PyFoam.FoamInformation import foamVersionString
    return foamVersionString()

_configuration = Configuration()

def configuration():
    """@return: The Configuration information of PyFoam"""
    return _configuration

# Should work with Python3 and Python2
It seems that you are (obviously) right, it still shows version 0.6.2. Why has this file not been updated during the process? How can I be sure that the libraries have been installed correctly by setup.py?
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 4, 2014, 17:06
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
This is how my "home/cfd/OpenFOAM/cfd-2.3.x/PyFoam/lib/python2.7/site-packages/PyFoam/__init__.py" looks like:

Code:
#  ICE Revision: $Id: /local/openfoam/Python/PyFoam/PyFoam/__init__.py 8489 2013-11-03T19:15:58.198885Z bgschaid  $
""" Utility-classes for OpenFOAM

Module for the Execution of OpenFOAM-commands and processing their output
"""

from PyFoam.Infrastructure.Configuration import Configuration

def version():
    """@return: Version number as a tuple"""
    return (0,6,2)
    #    return (0,6,3,"development")
It seems that you are (obviously) right, it still shows version 0.6.2. Why has this file not been updated during the process? How can I be sure that the libraries have been installed correctly by setup.py?
No idea. Retry running setup.py and check the output it. My guess is that it installs into a different directory
__________________
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   December 4, 2014, 17:13
Default
  #7
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
This is the output of the setup.py:

Code:
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/bin/pyFoamDumpConfiguration.py to 755
changing mode of /usr/bin/pyFoamCaseReport.py to 755
changing mode of /usr/bin/pyFoamStandardLogAnalyzer.py to 755
changing mode of /usr/bin/pyFoamBuildHelper.py to 755
changing mode of /usr/bin/pyFoamRunner.py to 755
changing mode of /usr/bin/pyFoamRunParameterVariation.py to 755
changing mode of /usr/bin/pyFoamFromTemplate.py to 755
changing mode of /usr/bin/pyFoamRedoPlot.py to 755
changing mode of /usr/bin/pyFoamBlockMeshRewrite.py to 755
changing mode of /usr/bin/pyFoamWriteDictionary.py to 755
changing mode of /usr/bin/pyFoamModifyGGIBoundary.py to 755
changing mode of /usr/bin/pyFoamExecute.py to 755
changing mode of /usr/bin/pyFoamReadDictionary.py to 755
changing mode of /usr/bin/pyFoamSTLUtility.py to 755
changing mode of /usr/bin/pyFoamInitVCSCase.py to 755
changing mode of /usr/bin/pyFoamAddEmptyBoundary.py to 755
changing mode of /usr/bin/pyFoamPrepareCase.py to 755
changing mode of /usr/bin/pyFoamCreateModuleFile.py to 755
changing mode of /usr/bin/pyFoamJoinCSV.py to 755
changing mode of /usr/bin/pyFoamUpgradeDictionariesTo20.py to 755
changing mode of /usr/bin/pyFoamCreateBoundaryPatches.py to 755
changing mode of /usr/bin/pyFoamCaseBuilder.py to 755
changing mode of /usr/bin/pyFoamEchoPickledApplicationData.py to 755
changing mode of /usr/bin/pyFoamPrintData2DStatistics.py to 755
changing mode of /usr/bin/pyFoamUpgradeDictionariesTo17.py to 755
changing mode of /usr/bin/pyFoamIPythonNotebook.py to 755
changing mode of /usr/bin/pyFoamCompressCaseFiles.py to 755
changing mode of /usr/bin/pyFoamBinarySize.py to 755
changing mode of /usr/bin/pyFoamTestConfiguration.py to 755
changing mode of /usr/bin/pyFoamUpdateDictionary.py to 755
changing mode of /usr/bin/pyFoamClearCase.py to 755
changing mode of /usr/bin/pyFoamEchoDictionary.py to 755
changing mode of /usr/bin/pyFoamClearInternalField.py to 755
changing mode of /usr/bin/pyFoamBench.py to 755
changing mode of /usr/bin/pyFoamNetShell.py to 755
changing mode of /usr/bin/pyFoamPVSnapshot.py to 755
changing mode of /usr/bin/pyFoamPVLoadState.py to 755
changing mode of /usr/bin/pyFoamUtilityRunner.py to 755
changing mode of /usr/bin/pyFoamDumpRunDatabaseToCSV.py to 755
changing mode of /usr/bin/pyFoamComparator.py to 755
changing mode of /usr/bin/pyFoamListCases.py to 755
changing mode of /usr/bin/pyFoamChangeBoundaryName.py to 755
changing mode of /usr/bin/pyFoamPlotRunner.py to 755
changing mode of /usr/bin/pyFoamPlotWatcher.py to 755
changing mode of /usr/bin/pyFoamCopyLastToFirst.py to 755
changing mode of /usr/bin/pyFoamClearBoundaryValue.py to 755
changing mode of /usr/bin/pyFoamAddCaseDataToDatabase.py to 755
changing mode of /usr/bin/pyFoamNetList.py to 755
changing mode of /usr/bin/pyFoamPotentialRunner.py to 755
changing mode of /usr/bin/pyFoamSteadyRunner.py to 755
changing mode of /usr/bin/pyFoamAPoMaFoXiiQt.py to 755
changing mode of /usr/bin/pyFoamMeshUtilityRunner.py to 755
changing mode of /usr/bin/pyFoamMetaServer.py to 755
changing mode of /usr/bin/pyFoamSymlinkToFile.py to 755
changing mode of /usr/bin/pyFoamRunAtMultipleTimes.py to 755
changing mode of /usr/bin/pyFoamSamplePlot.py to 755
changing mode of /usr/bin/pyFoamSGECommand.py to 755
changing mode of /usr/bin/pyFoamSurfacePlot.py to 755
changing mode of /usr/bin/pyFoamCloneCase.py to 755
changing mode of /usr/bin/pyFoamClusterTester.py to 755
changing mode of /usr/bin/pyFoamPackCase.py to 755
changing mode of /usr/bin/pyFoamChangeBoundaryType.py to 755
changing mode of /usr/bin/pyFoamVersion.py to 755
changing mode of /usr/bin/pyFoamConvertToCSV.py to 755
changing mode of /usr/bin/pyFoamDisplayBlockMesh.py to 755
changing mode of /usr/bin/pyFoamCompareDictionary.py to 755
changing mode of /usr/bin/pyFoamClearEmptyBoundaries.py to 755
changing mode of /usr/bin/pyFoamTimelinePlot.py to 755
changing mode of /usr/bin/pyFoamDecompose.py to 755
running install_egg_info
Removing /usr/lib/python2.7/site-packages/PyFoam-0.6.4-py2.7.egg-info
Writing /usr/lib/python2.7/site-packages/PyFoam-0.6.4-py2.7.egg-info
Maybe I should uninstall it before install it again?
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 5, 2014, 09:43
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
This is the output of the setup.py:

Code:
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/bin/pyFoamDumpConfiguration.py to 755
<<snip>>
changing mode of /usr/bin/pyFoamClearEmptyBoundaries.py to 755
changing mode of /usr/bin/pyFoamTimelinePlot.py to 755
changing mode of /usr/bin/pyFoamDecompose.py to 755
running install_egg_info
Removing /usr/lib/python2.7/site-packages/PyFoam-0.6.4-py2.7.egg-info
Writing /usr/lib/python2.7/site-packages/PyFoam-0.6.4-py2.7.egg-info
Maybe I should uninstall it before install it again?
You try that. For some reason no library files are copied at all. But there IS a PyFoam-directory (with sub-directories) in the folder where the setup-py is, right?
__________________
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   December 5, 2014, 10:15
Default
  #9
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Yes, of course, there is. Why are you asking for that directory? It was there even before I updated the application to 0.6.4 version.
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 7, 2014, 05:36
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
Yes, of course, there is. Why are you asking for that directory? It was there even before I updated the application to 0.6.4 version.
Because I was wondering why it is ignored. And the only thing I could think of is that it was missing for some reason
__________________
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   December 7, 2014, 13:35
Default
  #11
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
So what could be the problem? Why am I unable to run the new PyFoam version? What should I do to make it run properly?
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 9, 2014, 08:43
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
Yes, of course, there is. Why are you asking for that directory? It was there even before I updated the application to 0.6.4 version.
No idea. I tried setup.py on my machine and there is a whole lot of copying going on between "build_py" and "build_scripts". What is your exact command line? ("python setup.py ...")
__________________
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   December 9, 2014, 14:58
Default
  #13
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
The command line I executed was, as written in the first post, "sudo python setup.py install". This is the command shown in the wiki I think.
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   December 9, 2014, 19:58
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
The command line I executed was, as written in the first post, "sudo python setup.py install". This is the command shown in the wiki I think.
Wanted to be sure

I was only looking at the long output. If I reread every post in the threads before answering I would answer even less. ALSO: I've seen it often enough that people post the output to a different command than the one they gave 5 posts earlier. So the only command line I take seriously is the one given with the output. Everything else is guessing

Concerning the actual problem: for some reason setup.py doers not copy the Library-files. Which is strange because you said they are there. Permission problem is unlikely. Apart from that I have no idea
__________________
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tecplot 360 2017 Release 2 manohar1487 Main CFD Forum 0 August 28, 2017 03:08
New CastNet Release: GUI Environment for OpenFOAM and CalculiX MartinB OpenFOAM Announcements from Other Sources 0 January 13, 2017 11:27
FOAM-extend next release (release 3.2) - test phase extended to August 31st fguibault OpenFOAM Announcements from Other Sources 1 September 17, 2015 20:52
Belated Announcement of PyFoam 0.6.5 and swak4Foam 0.3.2 gschaider OpenFOAM Announcements from Other Sources 0 July 29, 2015 19:32
Having problems to Install OpenFOAM 13 release of PowerLab2 ed_teller OpenFOAM Installation 0 June 11, 2007 11:50


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