CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [PyFoam] pyFoamVersion.py "NameError: name 'pyFoamVersion' is not defined" (https://www.cfd-online.com/Forums/openfoam-community-contributions/127622-pyfoamversion-py-nameerror-name-pyfoamversion-not-defined.html)

cfdsat December 16, 2013 04:25

pyFoamVersion.py "NameError: name 'pyFoamVersion' is not defined"
 
I have installed PyFoam on my machine which has python 2.4 using the following command
python setup.py install --prefix=/home/nonroot/my_python

Included the below in my .bashrc file
export PYTHONPATH=/home/nonroot/my_python/lib/python-2.3/site-packages:$PYTHONPATH

export PATH=/home/nonroot/my_python/bin:$PATH
checked pyFoam installations by issuing the following commands
import PyFoam
import PyFoam.FoamInformation
print PyFoam.FoamInformation.foamTutorials()

But still pyFoamVersion.py command gives me the following

Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'pyFoamVersion' is not defined

Please let me know what is missing.

vigneshTG June 6, 2014 19:48

After PyFoam installation, I typed the three commands given in the installation webpage given below
import PyFoam
import PyFoam.FoamInformation
print PyFoam.FoamInformation.foamTutorials()

I get a blank message instead of the message (/home/nonroot/OpenFOAM/OpenFOAM-1.2-devel/tutorials) given in the webpage

Can someone help ??


Thanks and Regards
Vignesh TG

gschaider June 7, 2014 06:59

Quote:

Originally Posted by vigneshTG (Post 495983)
After PyFoam installation, I typed the three commands given in the installation webpage given below
import PyFoam
import PyFoam.FoamInformation
print PyFoam.FoamInformation.foamTutorials()

I get a blank message instead of the message (/home/nonroot/OpenFOAM/OpenFOAM-1.2-devel/tutorials) given in the webpage

Can someone help ??


Thanks and Regards
Vignesh TG

Probably no OF-version is initialized on that shell (environment variable FOAM_TUTORIALS is not set). Then this is the correct behaviour

Try pyFoamVersion.py for more info

vigneshTG June 7, 2014 14:57

Thank you for the quick reply Gschaider !!

Now it works


Regards
Vignesh TG


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