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

[PyFoam] Installation on a VM

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2022, 04:18
Default Installation on a VM
  #1
New Member
 
Jan
Join Date: Oct 2020
Posts: 11
Rep Power: 4
Kosdalak is on a distinguished road
Hello,

I recently installed a VM (via Hyper-V) on my Windows 10. I chose Ubuntu 22.04 LTS and installed OpenFoam-dev.

So far everything worked fine (OF runs fine and everything). Now I want to watch residuals, etc. with PyFoam. Therefore I installed the newest python 3.10 and then followed the guide (https://openfoamwiki.net/index.php/C...lling_with_pip) to install PyFoam with pip. Worked perferctly. Checked the installation with
Code:
import PyFoam
import PyFoam.FoamInformation
print PyFoam.FoamInformation.foamTutorials()
and got the right results as expected.

Now comes the trouble. I tried some differnt versions with the cavity tutorial:
- When I want to watch my residuals with the PlotWatcher.py I only got a new folder "log.analyzed"but it's completly empty. And also no plots at all.
- With "pyFoamPlotRunner.py icoFoam" the solver starts and I got all the different files. And also here I see no plots.

So my Problems seems to be the missing plots. Maybe because I'm using a VM. But here I'm lacking of experience and knowledge.

From other posts i learned to check my version with "pyFoamVersion.py" and got following message:

Code:
Machine info: Linux | OF1-TOJW10 | 5.15.0-1007-azure | #8-Ubuntu SMP Wed May 18 18:12:14 UTC 2022 | x86_64 | x86_64

Python version: 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0]

Python executable: /usr/bin/python3

Python 3 is supported with PyFoam
PYTHONPATH is not set

Location of this utility: /usr/local/bin/pyFoamVersion.py

 PyFoam WARNING on line 229 of file /usr/local/lib/python3.10/dist-packages/PyFoam/FoamInformation.py : Basedir /home/testuser/foam for fork extend does not exist or is not a directory
Version dev (reported as number 9.9.9 )Fork openfoam of the installed 0 versions:

pyFoam-Version: 2021.6

Path where PyFoam was found (PyFoam.__path__) is ['/usr/local/lib/python3.10/dist-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/testuser/.pyFoam/pyfoamrc'), ('directory', '/home/testuser/.pyFoam/pyfoamrc.d')]
Configuration files (used): []

Installed libraries:
cython                         :  Yes 	 version: 0.29.28
cProfile                       :  Yes
docutils                       :  No 	 Not necessary. Needed for RestructuredText to HTML conversion
Gnuplot                        :  No 	 Not a problem. Version from ThirdParty is used
hotshot                        :  No 	 Not a problem. Can't profile using this library
line_profiler                  :  No 	 Not a problem. Can't profile using this library
ipdb                           :  No 	 Not necessary. Only makes debugging more comfortable
IPython                        :  No 	 Not necessary. But the interactive shell may be more comfortable
matplotlib                     :  Yes 	 version: 3.5.1
mercurial                      :  No 	 Not a problem. Used for experimental case handling
pytest                         :  No 	 Only needed for running the unit-tests (developers only)
numpy                          :  Yes 	 version: 1.22.4
openpyxl                       :  No 	 Not a problem. Only used for exporting pandas-data to Excel-files (advanced). If xlsxwriter is installed it will handle this (xlsxwriter is recommended anyway)
xlsxwriter                     :  No 	 Not a problem. Only used for exporting pandas-data to XLSX-files (advanced). If openpyxl is installed then this module can handle that
pandas                         :  No 	 Not a problem. Only used for handling of advanced data-handling
ply                            :  Yes 	 version: 3.11
profile                        :  Yes
psyco                          :  No 	 Not a problem. Acceleration not possible
PyQt4                          :  No 	 Only some experimental GUI-stuff relies on this
PyQt4.Qwt5                     :  No 	 Only an alternate plotting back-end
scipy                          :  Yes 	 version: 1.8.0
Tkinter                        :  No 	 Not a problem. Used for the old version of DisplayBlockmesh and some matplotlib-implementations
twisted                        :  Yes 	 version: 22.1.0
vtk                            :  Yes 	 version: 9.1.20211106
xlwt                           :  No 	 Not a problem. Only used for exporting pandas-data to Excel-files
xlrd                           :  No 	 Not a problem. Only used for importing Excel-files to pandas-data
requests                       :  Yes 	 version: 2.25.1
zeroconf                       :  No 	 Not a problem. Necessary to find existing runs. Install with 'pip install zeroconf'
psutil                         :  No 	 Not a problem. Provides better calculation of the maximum used memory
PyFoam.ThirdParty.ply.yacc     :  Yes 	 version: 3.9
PyFoam.ThirdParty.Gnuplot      :  Yes 	 version: 1.8
PyFoam.ThirdParty.tqdm         :  Yes 	 version: 4.8.4
PyFoam.ThirdParty.IPy          :  Syntax Error 	 This is our own. If it is not found we've got problems
PyFoam.ThirdParty.pyratemp     :  Yes 	 version: 0.2.0
PyFoam.ThirdParty.six          :  Yes 	 version: 1.10.0
PyFoam.ThirdParty.winhacks     :  Yes

Library locations
cProfile                       : /usr/lib/python3.10/cProfile.py
cython                         : /usr/lib/python3/dist-packages/cython.py
matplotlib                     : /usr/lib/python3/dist-packages/matplotlib/__init__.py
numpy                          : /usr/local/lib/python3.10/dist-packages/numpy/__init__.py
ply                            : /usr/lib/python3/dist-packages/ply/__init__.py
profile                        : /usr/lib/python3.10/profile.py
PyFoam.ThirdParty.Gnuplot      : /usr/local/lib/python3.10/dist-packages/PyFoam/ThirdParty/Gnuplot/__init__.py
PyFoam.ThirdParty.ply.yacc     : /usr/local/lib/python3.10/dist-packages/PyFoam/ThirdParty/ply/yacc.py
PyFoam.ThirdParty.pyratemp     : /usr/local/lib/python3.10/dist-packages/PyFoam/ThirdParty/pyratemp.py
PyFoam.ThirdParty.six          : /usr/local/lib/python3.10/dist-packages/PyFoam/ThirdParty/six.py
PyFoam.ThirdParty.tqdm         : /usr/local/lib/python3.10/dist-packages/PyFoam/ThirdParty/tqdm/__init__.py
PyFoam.ThirdParty.winhacks     : /usr/local/lib/python3.10/dist-packages/PyFoam/ThirdParty/winhacks.py
requests                       : /usr/lib/python3/dist-packages/requests/__init__.py
scipy                          : /usr/lib/python3/dist-packages/scipy/__init__.py
twisted                        : /usr/lib/python3/dist-packages/twisted/__init__.py
vtk                            : /usr/lib/python3/dist-packages/vtkmodules/all.py

Checking additional envirnoment variables

Checking for PYFOAM_DIR : Location of the PyFoam-installation. Not strictly necessary
PYFOAM_DIR missing from environment

Checking for PYFOAM_SITE_DIR : Location of non-PyFoam-disctributions script. Set and used by some Foam-distributions
PYFOAM_SITE_DIR missing from environment

User information
Username:             testuser
Temporary directory:  /tmp/PyFoam_testuser
Public key:           11c79e2f01c6b614339c63c67c0e5041:14129c7ec2d279d4d0202291ed741b7b
Maybe my gnuplot is wrong or I missed something else. Any suggestion or help is appreciated.

Greetings
Jan
Kosdalak is offline   Reply With Quote

Old   October 2, 2022, 06:30
Default Pyfoam graphs not showing
  #2
New Member
 
Sanjay R
Join Date: Sep 2022
Posts: 5
Rep Power: 2
SanWick002 is on a distinguished road
I too have the same issue running in ubuntu22.04lts, did you find any solution??
SanWick002 is offline   Reply With Quote

Old   November 8, 2022, 12:49
Default Solution:
  #3
New Member
 
Jan
Join Date: Oct 2020
Posts: 11
Rep Power: 4
Kosdalak is on a distinguished road
Sooo I finally managed to start pyFoam probably.

I uninstalled all pyFoam stuff and reinstalled it using pip. But befor that I updated python with a quite nice hint.
Code:
sudo pip uninstall pyFoam
sudo apt install python3-pip python-is-python3
sudo pip install pyFoam
After that it worked like it should. I just found that solution with "python-is-python3". For the moment I don't know what it changes but that should be easy to find out by yourself.

Have fun and hopefully this post helps someone!

Greetings
Jan
Kosdalak is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ansys Installation on Docker Container mohsen.shiea ANSYS 10 June 16, 2021 19:31
how do i fix installation error of ansys 19.0 on ubuntu 18.04 rid_taki ANSYS 15 June 7, 2021 07:32
[foam-extend.org] A smooth installation of foam-3.0-extend on OpenSUSE 13.1 64-bits cookcaptain OpenFOAM Installation 7 May 26, 2015 12:22
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07


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