davesrocketshop / Rocket

FreeCAD Rocketry Workbench
GNU Lesser General Public License v2.1
49 stars 10 forks source link

Work bench fails to launch #63

Closed Jsevenh closed 11 months ago

Jsevenh commented 11 months ago

rocket work bench version 3.2.1 master branch Screenshot from 2023-10-13 09-26-49 I'm getting the above error while loading the workbench on freecad version 0.21.1 This is the report view output // report view 09:26:21 No module named 'PySide2.QtCharts' 09:26:21 Traceback (most recent call last): File "<"string">", line 49, in Initialize File "$HOME/snap/freecad/common/Mod/Rocket/./RocketGui.py", line 59, in from Ui.Commands.CmdFlutterAnalysis import CmdFinFlutter File "$HOME/snap/freecad/common/Mod/Rocket/./Ui/Commands/CmdFlutterAnalysis.py", line 34, in from Ui.DialogFinFlutter import DialogFinFlutter File "$HOME/snap/freecad/common/Mod/Rocket/./Ui/DialogFinFlutter.py", line 35, in from PySide2.QtCharts import QtCharts

davesrocketshop commented 11 months ago

Due to licensing issues, the dependency is not automatically included in the Linux versions of FreeCAD. I'll be removing this dependency in a future release.

In the meantime you can manually add it to your system. On ubuntu and likely most Debian derived systems you can do this with:

$ sudo apt install python3-pyqt5.qtchart

Jsevenh commented 11 months ago

Thank you for your response. In addition to your suggestion of using 'sudo apt install python3-pyqt5.qtchart,' I've also attempted to resolve the issue by running 'pip install PySide2.' Unfortunately, I'm still encountering the same error.

davesrocketshop commented 11 months ago

Well, let's start from the beginning. From the FreeCAD menu bar, select "Help"->"About FreeCAD". The dialog will show some information, including a button saying "Copy to clipboard". Push the button, and then paste here

Jsevenh commented 11 months ago

Well, let's start from the beginning. From the FreeCAD menu bar, select "Help"->"About FreeCAD". The dialog will show some information, including a button saying "Copy to clipboard". Push the button, and then paste here

[code] OS: Ubuntu Core 20 (ubuntu:GNOME/ubuntu) Word size of FreeCAD: 64-bit Version: 0.21.1.33668 +26 (Git) Snap 759 Build type: Release Branch: tag: 0.21.1 Hash: f6708547a9bb3f71a4aaade12109f511a72c207c Python 3.8.10, Qt 5.15.7, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.3 Locale: English/United States (en_US) Installed mods:

davesrocketshop commented 11 months ago

Ok, problem identified.

You're running FreeCAD from a snap. The key feature of the snap is that the program is packaged with its own dependencies, meaning it's not reliant on the packages installed by the OS. The other side of that coin is that installing missing packages on your OS will not be seen by the snap. So we're all out of luck there.

Plan B is to remove flutter analysis, and that will involve editing some lines of code. in the file ~/.local/share/FreeCAD/Mod/Rocket/Ui/Commands/CmdFlutterAnalysis.py you'll have to change lines 34-48 to look like this:

# from Ui.DialogFinFlutter import DialogFinFlutter
from Ui.Commands.Command import Command

 def calcFinFlutter():

    # See if we have a fin selected
    for fin in FreeCADGui.Selection.getSelection():
        if fin.isDerivedFrom('Part::FeaturePython'):
            if hasattr(fin,"FinType"):
                # try:
                #     form = DialogFinFlutter(fin)
                #     form.exec_()
                # except TypeError as ex:
                #     QtGui.QMessageBox.information(None, "", str(ex))
                return

Unfortunately it's a bit of a project to replace this code and it's going to be a while before I can get to it.

Jsevenh commented 11 months ago

Thanks , I really appreciate the help .

Jsevenh commented 11 months ago

While this may not pertain to the current topic, I'd like to inquire about the most effective approach for initiating workbench development.

davesrocketshop commented 11 months ago

I've just created a new release that handles the missing QtCharts module more gracefully. You still won't be able to use the flutter analysis dialog without it, but all other functionality will be unaffected.

davesrocketshop commented 11 months ago

While this may not pertain to the current topic, I'd like to inquire about the most effective approach for initiating workbench development.

Start here: https://wiki.freecad.org/Workbench_creation

Good ways to communicate more interactively are through twitter @davesrocketshop ro via the FreeCAD discord channel

Jsevenh commented 11 months ago

Thanks ,

davesrocketshop commented 11 months ago

I'm going to leave this issue open. The last release allows for graceful failure, but it is still failure not a fix.

The fix is to remove the requirement for QtCharts

davesrocketshop commented 11 months ago

Fixed in v3.2.3.

The dependence on QtCharts has been removed, and the flutter dialog uses matplotlib instead. This package is part of the FreeCAD install and should be available on all supported platforms.

You should have full functionality with no need for any work arounds.

Jsevenh commented 11 months ago

Your efforts are greatly appreciated