[Solved] Matplotlib not found

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

Post Reply
kasfia1
Posts: 4
Joined: Wed Jan 26, 2022 8:56 pm

[Solved] Matplotlib not found

Post by kasfia1 »

Hi I am new to FreeCAD and I am trying to install CfdOF. I have installed Plot WB and CfdOF WB, but I run into these two errors when opening CfdSolver that I cannot solve. Running on Windows 10 with Python 3.7
image-1.PNG
image-1.PNG (24.11 KiB) Viewed 3424 times
double click CfdOF-->

Code: Select all

16:03:06  matplotlib not found, so Plot module can not be loaded
click write-->

Code: Select all

16:03:18  Writing case to folder C:\Users\user\AppData\Local\Temp
16:03:18  Traceback (most recent call last):
16:03:18    File "C:\Users\user\AppData\Roaming\FreeCAD\Mod\CfdOF\_TaskPanelCfdSolverControl.py", line 129, in write_input_file_handler
16:03:18      FreeCADGui.doCommand("writer.writeCase()")
16:03:18    File "<string>", line 1, in <module>
16:03:18    File "C:\Users\user\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdCaseWriterFoam.py", line 106, in writeCase
16:03:18      self.processInitialConditions()
16:03:18    File "C:\Users\user\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdCaseWriterFoam.py", line 373, in processInitialConditions
16:03:18      raise RuntimeError("No boundary selected to copy initial pressure value from.")
16:03:18  RuntimeError: No boundary selected to copy initial pressure value from.
Here is the dependency checker results:

Code: Select all

15:52:01  Checking CFD workbench dependencies...
15:52:01  Checking FreeCAD version
15:52:01  Checking for OpenFOAM:
15:52:01  OpenFOAM directory: C:\Program Files\ESI-OpenCFD\OpenFOAM\v2012
15:52:01  System: Windows
15:52:01  Runtime: MinGW
15:52:01  Running  echo $FOAM_API
15:52:01  Raw command:  ['C:/Program Files/FreeCAD 0.19/bin\\python.exe', '-u', 'C:\\Users\\user\\AppData\\Roaming\\FreeCAD\\Mod\\CfdOF\\WindowsRunWrapper.py', 'C:\\Program Files\\ESI-OpenCFD\\OpenFOAM\\v2012\\msys64\\usr\\bin\\bash', '--login', '-O', 'expand_aliases', '-c', 'echo Sourcing OpenFOAM environment...; source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc; export PATH=$FOAM_LIBBIN/msmpi:$FOAM_LIBBIN:$WM_THIRD_PARTY_DIR/platforms/linux64MingwDPInt32/lib:$PATH; echo $FOAM_API']
15:52:01  Sourcing OpenFOAM environment...
15:52:01  openfoam: windows support (mingw64) is runtime only
15:52:39  2012
15:52:39  Running  cartesianMesh -version
15:52:41  Raw command:  ['C:/Program Files/FreeCAD 0.19/bin\\python.exe', '-u', 'C:\\Users\\user\\AppData\\Roaming\\FreeCAD\\Mod\\CfdOF\\WindowsRunWrapper.py', 'C:\\Program Files\\ESI-OpenCFD\\OpenFOAM\\v2012\\msys64\\usr\\bin\\bash', '--login', '-O', 'expand_aliases', '-c', 'echo Sourcing OpenFOAM environment...; source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc; export PATH=$FOAM_LIBBIN/msmpi:$FOAM_LIBBIN:$WM_THIRD_PARTY_DIR/platforms/linux64MingwDPInt32/lib:$PATH; cartesianMesh -version']
15:52:41  Sourcing OpenFOAM environment...
15:52:41  openfoam: windows support (mingw64) is runtime only
15:53:20  /*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 79e353b84e-20201222 OPENFOAM=2012
Arch   : "LSB;label=32;scalar=64"
Exec   : C:\Program Files\ESI-OpenCFD\OpenFOAM\v2012\msys64\home\ofuser\OpenFOAM\OpenFOAM-v2012\platforms\win64MingwDPInt32Opt\bin\cartesianMesh.exe -version
Date   : Jan 26 2022
Time   : 15:53:20
Host   : LAPTOP-R309ESGN
PID    : 2108
I/O    : uncollated
Case   : C:/Program Files/ESI-OpenCFD/OpenFOAM/v2012/msys64/home/ofuser
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
cfMesh-CfdOF (cfMesh 1.1.2) 1.8
15:53:20  Running  hisa -version
15:53:21  Raw command:  ['C:/Program Files/FreeCAD 0.19/bin\\python.exe', '-u', 'C:\\Users\\user\\AppData\\Roaming\\FreeCAD\\Mod\\CfdOF\\WindowsRunWrapper.py', 'C:\\Program Files\\ESI-OpenCFD\\OpenFOAM\\v2012\\msys64\\usr\\bin\\bash', '--login', '-O', 'expand_aliases', '-c', 'echo Sourcing OpenFOAM environment...; source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc; export PATH=$FOAM_LIBBIN/msmpi:$FOAM_LIBBIN:$WM_THIRD_PARTY_DIR/platforms/linux64MingwDPInt32/lib:$PATH; hisa -version']
15:53:21  Sourcing OpenFOAM environment...
15:53:21  openfoam: windows support (mingw64) is runtime only
15:54:01  /*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 79e353b84e-20201222 OPENFOAM=2012
Arch   : "LSB;label=32;scalar=64"
Exec   : C:\Program Files\ESI-OpenCFD\OpenFOAM\v2012\msys64\home\ofuser\OpenFOAM\OpenFOAM-v2012\platforms\win64MingwDPInt32Opt\bin\hisa.exe -version
Date   : Jan 26 2022
Time   : 15:54:01
Host   : LAPTOP-R309ESGN
PID    : 14428
I/O    : uncollated
Case   : C:/Program Files/ESI-OpenCFD/OpenFOAM/v2012/msys64/home/ofuser
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
hisa 1.4.2
15:54:01  Checking for paraview:
15:54:02  Checking for Plot module:
15:54:02  C:\Program Files\FreeCAD 0.19\bin\lib\importlib\__init__.py:127: MatplotlibDeprecationWarning: 
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
  return _bootstrap._gcd_import(name[level:], package, level)
15:54:02  matplotlib not found, so Plot module can not be loaded
15:54:02  Checking for gmsh:
15:54:02  Running  'C:/Program Files/FreeCAD 0.19/bin/gmsh.exe' -version
15:54:02  Raw command:  ['C:/Program Files/FreeCAD 0.19/bin\\python.exe', '-u', 'C:\\Users\\user\\AppData\\Roaming\\FreeCAD\\Mod\\CfdOF\\WindowsRunWrapper.py', 'C:\\Program Files\\ESI-OpenCFD\\OpenFOAM\\v2012\\msys64\\usr\\bin\\bash', '--login', '-O', 'expand_aliases', '-c', "echo Sourcing OpenFOAM environment...; source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc; export PATH=$FOAM_LIBBIN/msmpi:$FOAM_LIBBIN:$WM_THIRD_PARTY_DIR/platforms/linux64MingwDPInt32/lib:$PATH; 'C:/Program Files/FreeCAD 0.19/bin/gmsh.exe' -version"]
15:54:02  Sourcing OpenFOAM environment...
15:54:02  openfoam: windows support (mingw64) is runtime only
15:54:44  4.8.4
15:54:44  Completed CFD dependency check
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
Last edited by kasfia1 on Tue Feb 08, 2022 4:37 pm, edited 2 times in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Matplotlib not found

Post by Kunda1 »

Moved to CfdOF subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Matplotlib not found

Post by oliveroxtoby »

kasfia1 wrote: Wed Jan 26, 2022 9:04 pm Hi I am new to FreeCAD and I am trying to install CfdOF. I have installed Plot WB and CfdOF WB, but I run into these two errors when opening CfdSolver that I cannot solve. Running on Windows 10 with Python 3.7
image-1.PNG
I suggest you uninstall all versions of MSMPI and then repeat the installation of OpenFOAM.
double click CfdOF-->

Code: Select all

16:03:06  matplotlib not found, so Plot module can not be loaded
Strange...Could you please provide full version information (instructions in the link below).
Please provide all the information requested in this post before reporting problems with CfdOF.
kasfia1
Posts: 4
Joined: Wed Jan 26, 2022 8:56 pm

Re: Matplotlib not found

Post by kasfia1 »

double click CfdSolver-->

Code: Select all

14:24:31  C:\Program Files\FreeCAD 0.19\bin\lib\importlib\__init__.py:127: MatplotlibDeprecationWarning: 
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
  return _bootstrap._gcd_import(name[level:], package, level)
14:24:31  matplotlib not found, so Plot module can not be loaded
14:44:16  Writing case to folder C:\Users\user\AppData\Local\Temp
14:44:16  Traceback (most recent call last):
14:44:16    File "C:\Users\user\AppData\Roaming\FreeCAD\Mod\CfdOF\_TaskPanelCfdSolverControl.py", line 129, in write_input_file_handler
14:44:16      FreeCADGui.doCommand("writer.writeCase()")
14:44:16    File "<string>", line 1, in <module>
14:44:16    File "C:\Users\user\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdCaseWriterFoam.py", line 106, in writeCase
14:44:16      self.processInitialConditions()
14:44:16    File "C:\Users\user\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdCaseWriterFoam.py", line 373, in processInitialConditions
14:44:16      raise RuntimeError("No boundary selected to copy initial pressure value from.")
14:44:16  RuntimeError: No boundary selected to copy initial pressure value from.
Python console-->

Code: Select all

Python 3.8.6+ (heads/3.8-dirty:a12f459ec2, Nov  5 2020, 12:01:10) [MSC v.1927 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> Gui.runCommand('Std_Workbench',20)
>>> Gui.runCommand('Std_ViewStatusBar',1)
>>> Gui.runCommand('Std_ViewStatusBar',0)
>>> MRU="0"
>>> with open('C:/Program Files/FreeCAD 0.19/data/Mod/Start/StartPage/LoadMRU.py') as file:
>>> 	exec(file.read())
>>> FreeCAD.openDocument('C:/Users/user/OneDrive/FreeCAD/CdfoD.FCStd')
>>> # App.setActiveDocument("CdfoD")
>>> # App.ActiveDocument=App.getDocument("CdfoD")
>>> # Gui.ActiveDocument=Gui.getDocument("CdfoD")
>>> # Gui.Selection.addSelection('CdfoD','CfdSolver')
>>> # Gui.Selection.clearSelection()
>>> ### Begin command Std_Workbench
>>> Gui.activateWorkbench("CfdOFWorkbench")
>>> ### End command Std_Workbench
>>> # Gui.Selection.addSelection('CdfoD','CfdSolver')
>>> App.getDocument('CdfoD').getObject('CfdSolver').ViewObject.doubleClicked()
>>> App.getDocument('CdfoD').getObject('CfdSolver').ViewObject.doubleClicked()
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Matplotlib not found

Post by oliveroxtoby »

kasfia1 wrote: Fri Jan 28, 2022 7:27 pm
Please supply the version information from Help | About FreeCAD | Copy to clipboard
kasfia1
Posts: 4
Joined: Wed Jan 26, 2022 8:56 pm

Re: Matplotlib not found

Post by kasfia1 »

Sorry about all of the back and forth. Thanks so much for all the help!

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Matplotlib not found

Post by Syres »

The thing that jumps out to me is the OP stated Python 3.7 on Windows 10 so is Python 3.7 in the Path and therefore causing a confict with the Python 3.8.6+ bundled in the 0.19.3 Windows LP build?
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Matplotlib not found

Post by oliveroxtoby »

kasfia1 wrote: Wed Jan 26, 2022 9:04 pm

Code: Select all

16:03:06  matplotlib not found, so Plot module can not be loaded
This seems to be a spurious error, but if you update your CfdOF workbench now it should be gone.

Code: Select all

16:03:18  RuntimeError: No boundary selected to copy initial pressure value from.
You need to double-click on "InitialiseFields" and choose a boundary for any field where "Use value from initial field" is chosen.
kasfia1
Posts: 4
Joined: Wed Jan 26, 2022 8:56 pm

Re: Matplotlib not found

Post by kasfia1 »

Thank you so much; those two comments helped fix my error!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Matplotlib not found

Post by Kunda1 »

kasfia1 wrote: Sat Jan 29, 2022 10:57 pm Thank you so much; those two comments helped fix my error!
Please append [Solved] to the title of the first post in this thread. Thanks.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply