jaheyns / CfdOF

Computational Fluid Dynamics (CFD) for FreeCAD based on OpenFOAM solver
GNU Lesser General Public License v3.0
442 stars 84 forks source link

Bug reporting: No module named 'certifi' #149

Closed davesrocketshop closed 6 months ago

davesrocketshop commented 6 months ago

When loading the latest CfDOF on windows, I get the following error:

04:35:15  Init:      Initializing C:\Users\dcarter\AppData\Roaming\FreeCAD\Mod\CfdOF\.\... failed
04:35:15  ----------------------------------------------------------------------------------------------------
04:35:15  Traceback (most recent call last):
  File "<string>", line 136, in RunInitGuiPy
  File "<string>", line 118, in <module>
  File "<string>", line 33, in __init__
  File "C:\Program Files\FreeCAD 0.21\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Users\dcarter\AppData\Roaming\FreeCAD\Mod\CfdOF\.\CfdOF\CfdPreferencePage.py", line 31, in <module>
    import certifi
  File "C:\Program Files\FreeCAD 0.21\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'certifi'
04:35:15  ----------------------------------------------------------------------------------------------------
04:35:16  During initialization the error "No module named 'certifi'" occurred in C:\Users\dcarter\AppData\Roaming\FreeCAD\Mod\CfdOF\.\InitGui.py
04:35:16  Please look into the log file for further information
OS: Windows 11 build 22621
Word size of FreeCAD: 64-bit
Version: 0.21.0.33668 +7 (Git)
Build type: Release
Branch: (HEAD detached at 0.21)
Hash: 41b058e2087de60dc8fef3d3e68c7d0129e13abf
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * 3D_Printing_Tools
  * A2plus 0.4.60n
  * AirPlaneDesign 0.4.0
  * ArchTextures
  * Assembly3 0.12.0
  * Assembly4 0.50.4
  * CfdOF 1.24.6
  * CurvedShapes 1.0.4
  * Curves 0.6.13
  * ExplodedAssembly
  * fasteners 0.4.67
  * fcgear 1.0.0
  * FeedsAndSpeeds 0.5.0
  * GDML 2.0.0
  * kicadStepUpMod 10.20.7
  * LCInterlocking
  * MaterialTest
  * parts_library
  * Plot 2022.4.17
  * Render 2023.8.18
  * Rocket 3.2.3
davesrocketshop commented 6 months ago

I notice you have no dependencies listed in package.xml. Here's an example of the dependencies listed in the Rocket Workbench pacakage.xml:

  <content>
    <workbench>
      <classname>RocketWorkbench</classname>
      <subdirectory>./</subdirectory>
      <tag>rocket</tag>

      <!-- Required by the atmospheric model -->
      <depend>numpy</depend>

      <depend>Fem</depend>
      <depend>Material</depend>
      <depend>matplotlib</depend>
    </workbench>
  </content>

In my case, it includes dependencies on both internal modules, and Python packages

davesrocketshop commented 6 months ago

Workaround: Go to you install bin directory:

PS C:\Program Files\FreeCAD 0.21\bin> .\python -m pip install certifi
oliveroxtoby commented 6 months ago

Sorry about that. The package is in the 0.22 dev build package on Windows; I never checked 0.21. I have made it optional. Hopefully it's OK now.