Can't install this workbench

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
NewJoker
Veteran
Posts: 1177
Joined: Sun Oct 11, 2020 7:49 pm

Can't install this workbench

Post by NewJoker »

Hi,

I have the CfdOF workbench installed on one PC but now I'd like to have it on another machine as well and I've encountered a strange issue with installation. When I choose this workbench in the Addon Manager and press Install/update selected, the following message appears:

Code: Select all

Some errors were found that prevent to install this workbench: Some errors were found that prevent to install this workbench. Please install the missing components first.
Then I close the Addon Manager and it tells me that FreeCAD must be restarted. After that, the workbench is still not installed. The message encountered in the Addon Manager tells me to install components (OpenFOAM and others) first but I can't do it since the settings menu for the CfdOF workbench is not available in Edit --> Preferences (because the workbench failed to install). Was there some change/regression in the installation procedure ? I was able to complete it some time ago for the same version of FreeCAD (0.19).

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Polish/Poland (pl_PL)
User avatar
oliveroxtoby
Posts: 645
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install this workbench

Post by oliveroxtoby »

NewJoker wrote: Fri Feb 25, 2022 6:09 pm Hi,

I have the CfdOF workbench installed on one PC but now I'd like to have it on another machine as well and I've encountered a strange issue with installation. When I choose this workbench in the Addon Manager and press Install/update selected, the following message appears:

Code: Select all

Some errors were found that prevent to install this workbench: Some errors were found that prevent to install this workbench. Please install the missing components first.
I'm not sure what's happening here, but have you tried installing the Plot workbench first?
NewJoker
Veteran
Posts: 1177
Joined: Sun Oct 11, 2020 7:49 pm

Re: Can't install this workbench

Post by NewJoker »

oliveroxtoby wrote: Fri Feb 25, 2022 7:42 pm I'm not sure what's happening here, but have you tried installing the Plot workbench first?
Thanks, it worked when I installed the Plot workbench first. Maybe the error message I was getting before ("Please install the missing components first") could be expanded a bit to indicate specifically that the Plot workbench needs to be installed.
User avatar
oliveroxtoby
Posts: 645
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install this workbench

Post by oliveroxtoby »

NewJoker wrote: Sat Feb 26, 2022 10:59 am
oliveroxtoby wrote: Fri Feb 25, 2022 7:42 pm I'm not sure what's happening here, but have you tried installing the Plot workbench first?
Thanks, it worked when I installed the Plot workbench first. Maybe the error message I was getting before ("Please install the missing components first") could be expanded a bit to indicate specifically that the Plot workbench needs to be installed.
Great. The addon manager has been completely refactored for 0.20 (by @chennes) so I'm fairly sure this won't be a problem in future.
herbk
Veteran
Posts: 2426
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Can't install this workbench

Post by herbk »

Hi Oliver,
oliveroxtoby wrote: Sat Feb 26, 2022 8:06 pm ... The addon manager has been completely refactored for 0.20 (by @chennes) so I'm fairly sure this won't be a problem in future.
Dos the addon manager know the dependecy of each WB? I don't think so... ;) ;)
Gruß Herbert
User avatar
oliveroxtoby
Posts: 645
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install this workbench

Post by oliveroxtoby »

herbk wrote: Sun Feb 27, 2022 9:16 am Hi Oliver,
oliveroxtoby wrote: Sat Feb 26, 2022 8:06 pm ... The addon manager has been completely refactored for 0.20 (by @chennes) so I'm fairly sure this won't be a problem in future.
Dos the addon manager know the dependecy of each WB? I don't think so... ;) ;)
Workbenches can declare their dependencies in their metadata.txt or package.xml files.
User avatar
chennes
Veteran
Posts: 2238
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Can't install this workbench

Post by chennes »

oliveroxtoby wrote: Sun Feb 27, 2022 4:31 pm Workbenches can declare their dependencies in their metadata.txt or package.xml files.
I'm glad you mentioned that here -- it prompted me to try to install this WB, and I discovered I couldn't because it declares a dependency on the Plot Workbench. This took my down a whole big rabbit hole, but the upshot is that as of 17 Aug 2021 in git commit b7d06844c, Plot is no longer a Workbench, it is just a Module (that is, it has no InitGui.py file, and no main class derived from Workbench). Which currently means that you can't declare a dependency on it, because that code can only look for workbenches!

There are a two paths forward, both of which involve changing that dependency line. First, you can handle it entirely within CfdOF -- remove the dependency line entirely, and just do something like:

Code: Select all

try:
    import Plot
catch ImportError:
    FreeCAD.Console.PrintError(translate("CfdOF","Failed to import Plot module. Exiting CfdOF.")
    return
Second, you can modify the dependency to say "Plot" instead of "Plot Workbench", and I can write the above code in the Addon Manager, refusing to even install CfdOF if you don't have Plot.

Do you have a preference between the two?
Chris Hennes
Pioneer Library System
User avatar
oliveroxtoby
Posts: 645
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install this workbench

Post by oliveroxtoby »

chennes wrote: Mon Feb 28, 2022 3:33 am
oliveroxtoby wrote: Sun Feb 27, 2022 4:31 pm Workbenches can declare their dependencies in their metadata.txt or package.xml files.
I'm glad you mentioned that here -- it prompted me to try to install this WB, and I discovered I couldn't because it declares a dependency on the Plot Workbench. This took my down a whole big rabbit hole, but the upshot is that as of 17 Aug 2021 in git commit b7d06844c, Plot is no longer a Workbench, it is just a Module (that is, it has no InitGui.py file, and no main class derived from Workbench). Which currently means that you can't declare a dependency on it, because that code can only look for workbenches!

There are a two paths forward, both of which involve changing that dependency line. First, you can handle it entirely within CfdOF -- remove the dependency line entirely, and just do something like:

Code: Select all

try:
    import Plot
catch ImportError:
    FreeCAD.Console.PrintError(translate("CfdOF","Failed to import Plot module. Exiting CfdOF.")
    return
Second, you can modify the dependency to say "Plot" instead of "Plot Workbench", and I can write the above code in the Addon Manager, refusing to even install CfdOF if you don't have Plot.

Do you have a preference between the two?
Thanks for testing. At the moment I still have the Plot workbench listed as a dependency because the Plot module is not yet included in the Appimage build (forum post here and pull request here). So for the moment, on 0.20 the workbench tries to load the module and if that fails, falls back to the workbench (which does still seem to work - at least on the appimage - unless I am missing something). So I thought it was safter to keep this dependency until this is sorted out.

Anyway I'm happy to handle this from within CfdOF. As far as I've seen, the new addon manager seems to be working as advertised :-)
Post Reply