Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI example not compatible with Python version >3.4? #12

Closed
CrashBurnRepeat opened this issue Jul 15, 2020 · 3 comments
Closed

GUI example not compatible with Python version >3.4? #12

CrashBurnRepeat opened this issue Jul 15, 2020 · 3 comments

Comments

@CrashBurnRepeat
Copy link

Hello,

I've been trying to get the GUI demo working on my computer (MacOS 10.15.5 and FreeCAD v0.18.4) and it looks like PySide has transitioned to PySide2 for versions of Python beyond 3.4 (I'm running 3.6.7). However, it looks like the two are not easily interchangeable and the macro debugging features in FreeCAD are not working for me. Please let me know how I can extract a more helpful error message, but the only feedback I'm getting from FreeCAD is that when I try to run the macro, a traceback shows up at the bottom of the window but gets cut off before I can see any actually useful information.

The reason I'm suspecting PySide as a culprit is because when I try to run the macro from the terminal, I get an exception about not being able to find the PySide module, which I can't have for the version of Python I'm using. I would continue to debug in this way, but eventually I'd need the FreeCADGui module, and I haven't found how to install it outside of the FreeCAD environment (if that even makes sense to try).

If there's any additional information I can provide to help, please let me know. Thanks!

@fandaL
Copy link
Collaborator

fandaL commented Jul 15, 2020

Hello,
GUI is intended to work only under FreeCAD - it uses FreeCAD libraries and modules, so that it will hardly run outside. For obtaining more detailed error message go to FreeCAD View -> Panels -> Report View

If I understand this page https://wiki.freecadweb.org/PySide correctly, PySide2 is handled as PySide in FreeCAD, so I would expect error somewhere else. I did not try it on MacOS. You can also try development version FreeCAD 0.19 https://github.com/FreeCAD/FreeCAD/releases/tag/0.19_pre which is now relatively stable.

@CrashBurnRepeat
Copy link
Author

@fandaL thank you for the direction, it was a mistake on my end. I was just looking at example 4 and missed the line about opening the FreeCAD file, so I didn't have freecad_input.FCStd open when I was trying to run the macro. I'd assumed (incorrectly, of course) that I'd be able to select the data to work on in the macro itself, not that I'd already need it open. Might I suggest coding in an alert message if there's no active document? Apparently noobs like me need the help 😅

@fandaL
Copy link
Collaborator

fandaL commented Jul 15, 2020

I have added test so that if active document is empty, new is created and warning message is printed in the report view instead of obtaining an error. 66f27f8

@fandaL fandaL closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants