|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Dan
Join Date: Nov 2013
Posts: 22
Rep Power: 11 ![]() |
Hi all,
I'm having troubles with pyFoam installation. I have followed the wiki: https://openfoamwiki.net/index.php/C...m#Installation I didn't success installing in any way (as root, as user, using pip, etc.). I have decided to ask for help step by step. First, right now I have installed pyfoam using pip. It has been installed into ~/.local/lib/python2.7/site/packages. This is what I get when I run the steps proposed in the wiki page> Code:
dan@dan-Gazelle:~$ python Python 2.7.11+ (default, Apr 17 2016, 14:00:29) [GCC 5.3.1 20160413] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import PyFoam >>> import PyFoam.FoamInformation >>> print PyFoam.FoamInformation.foamTutorials() >>> import sys >>> print sys.path ['', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/dan/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0'] >>> dan@dan-Gazelle:~$ pyFoamVersion.py Traceback (most recent call last): File "/usr/local/bin/pyFoamVersion.py", line 4, in <module> __import__('pkg_resources').run_script('PyFoam==0.6.5', 'pyFoamVersion.py') File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 719, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1496, in run_script raise ResolutionError("No script named %r" % script_name) pkg_resources.ResolutionError: No script named 'pyFoamVersion.py' Thanks in advance |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 9 ![]() |
Hi
I dont know what is wrong but I can tell you that I installed pyfoam on ubuntu16.04 with pip and it worked like a charm. Now for scientific work I use a locally installed anaconda python installation instead of the systm one's. It make things easier for me. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Dan
Join Date: Nov 2013
Posts: 22
Rep Power: 11 ![]() |
Thank you jf_vt,
It is very good to hear that there should not be a problem at least! ![]() Now I simply need to find mine... ![]() Thanks! PS: I'll check out the anaconda stuff too, the website looks fine, I wanna get my superpowers too ... hehehe |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 9 ![]() |
your python version in /usr/lib it is a system installed version
it is usually not recomended to customize system version whih is used by the system. I had install problems similar to yours in the past ( not with pyfoam) which I did not try to solve once I was advised to install my own version of python to work with( anaconda is a popular choice I like but you have many other options) google it and you will find everyting you need. JF |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Dan
Join Date: Nov 2013
Posts: 22
Rep Power: 11 ![]() |
Hei,
I have already tried to have a different version of python, in my case I used 3.5.2 in a user folder. It didn't succeed either. I just saw today that there is a very new version of pyFoam (1 day old), the 0.6.6. These pyFoam amazing people just updated some details of the wiki page recommending the "pip" installation. I have tried to download as pip (succeed) but when I tried to import pyFoam in my python I got the following message: Code:
dan@dan-Gazelle:~/src$ python Python 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pyFoam Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pyFoam >>> Hopefully the following hours-days the wiki page will be a bit more detailed, if not, please, anybody could drop some light? I am really willing to use pyFoam. Thank you very much |
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 11 ![]() |
Hi,
Can it be just a typo in your case? From the same link you posted, it looks like PyFoam has a capital P Code:
import PyFoam import PyFoam.FoamInformation print PyFoam.FoamInformation.foamTutorials() Code:
pyFoamPlotRunner.py MySolverName Code:
pyFoamPlotRunner.py: command not found Thanks Cheers |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Dan
Join Date: Nov 2013
Posts: 22
Rep Power: 11 ![]() |
Amazing,
My two posts (first and last) disagree with the capital 'P' or not capital 'p'. I'll try it at some point in the following days and I write down my results. Thank you! |
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Join Date: Jul 2014
Posts: 26
Rep Power: 11 ![]() |
Oh and another thing that may help, but I am sure you have already checked it.
Before typing python and do all that import bla bla bla, I think you have to be in the openFoam shell |
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Liwei Zhang
Join Date: Jun 2017
Posts: 10
Rep Power: 8 ![]() |
I have used pip install PyFoam.everything seems well.But when i use print PyFoam.there is no message feedback.i hope someone can help me out...
Sent from my iPhone using CFD Online Forum mobile app |
|
![]() |
![]() |
![]() |
![]() |
#10 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,969
Blog Entries: 45
Rep Power: 127 ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
__________________
|
||
![]() |
![]() |
![]() |
![]() |
#11 | |
New Member
Liwei Zhang
Join Date: Jun 2017
Posts: 10
Rep Power: 8 ![]() |
Quote:
I have figured it out.i used pip install pyfoam follow the openfoam wiki.but it default install dir is not the same with the environment variable writed on the openfoam wiki.So i need to change the pythonpath to where the pyfoam installed. Sent from my iPhone using CFD Online Forum mobile app |
||
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Dan
Join Date: Nov 2013
Posts: 22
Rep Power: 11 ![]() |
Minisasi you were right about the upper-lower case mistake....
![]() Thank you! |
|
![]() |
![]() |
![]() |
![]() |
#13 |
New Member
hadi
Join Date: Jun 2015
Posts: 12
Rep Power: 10 ![]() |
I had the same problem and FInally I figured it out as follows:
python3.8 Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import PyFoam >>> import PyFoam.FoamInformation >>> print (PyFoam.FoamInformation.foamTutorials()) /opt/openfoam8/tutorials Pay attention to first command python3.8 and also the print, it should be written inside pranthesis |
|
![]() |
![]() |
![]() |
Tags |
pyfoam ubuntu 16.04 pip |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Can't find installation instruction for Openfoam 2.4.x , on Ubuntu 16.04 | titanium | OpenFOAM Installation | 14 | February 20, 2020 11:46 |
[OpenFOAM.com] Installation of OpenFOAM 1.7.1 on Ubuntu 16.04 | MM_Khan | OpenFOAM Installation | 11 | September 3, 2017 09:22 |
[foam-extend.org] foam-extend-3.2 on ubuntu 16.04 lts | FlyBob91 | OpenFOAM Installation | 1 | May 27, 2017 07:26 |
[OpenFOAM.org] Building OpenFOAM 3.0.1 on Ubuntu 16.04 - failed | erico | OpenFOAM Installation | 30 | February 2, 2017 09:24 |
[OpenFOAM.org] Building problem with Paraview 4.1.0 on Ubuntu 16.04 | nigala | OpenFOAM Installation | 2 | June 20, 2016 10:18 |