SOLVED: no halt at matplotlib.pyplot.show()

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

SOLVED: no halt at matplotlib.pyplot.show()

Post by HarryvL »

Normally python execution halts when calling matplotlib.pyplot.show(). This worked fine 3 years ago when I wrote the following macro: https://forum.freecadweb.org/viewtopic. ... 60#p306681. Back then, execution halted on matplotlib.pyplot.show() for the user to press <stop> or <add> and would then be terminated or continued, depending on the response. For some reason, in FC20, the plot is shown, but execution continues regardless. Did anything change in FC20 that might cause this behavior? If so, how could I overcome this? GOOGLE doesn't help me any further.

Code: Select all

OS: Ubuntu 22.04 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.28896 (Git)
Build type: Unknown
Branch: master
Hash: 8996cddbc043d1d8d27d27c25d2a25916b5287e7
Python 3.10.4, Qt 5.15.3, Coin 4.0.0, OCC 7.5.1
Locale: English/United States (en_US)
Last edited by HarryvL on Tue May 31, 2022 11:36 am, edited 1 time in total.
User avatar
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: no halt at matplotlib.pyplot.show()

Post by HarryvL »

PS: print output is also no longer generated in the Report View window until after the macro completes
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: no halt at matplotlib.pyplot.show()

Post by Kunda1 »

Just a wild guess, but plot workbench was made in to an external workbench downloadable through the AddonManager.
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
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: no halt at matplotlib.pyplot.show()

Post by HarryvL »

I get a warning at start-up:

Code: Select all

16:56:48  Addon Manager Warning: Could not import QtWebEngineWidgets, it seems to be missing from your system. Please use your system's package manager to install the python3-pyside2.qtwebengine* and python3-pyside2.qtwebchannel packages, and if possible alert your package creator to the missing dependency. Display of package README will be limited until this dependency is resolved.
Perhaps it has to do with the missing packages?!

PS: matplotlib is an external library, not a user addon.
User avatar
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: no halt at matplotlib.pyplot.show()

Post by HarryvL »

According to aptitude the two packages are installed on my machine.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: no halt at matplotlib.pyplot.show()

Post by Kunda1 »

Not sure if i was clear, Plot workbench is now an external workbench. You can grab it through the Addon Manager. IIRC, the addon manager will auto-install matplotlib as well.
Plot wb available through addon manager
Plot wb available through addon manager
Screenshot_20220526_112324.png (71.78 KiB) Viewed 831 times
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
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: no halt at matplotlib.pyplot.show()

Post by HarryvL »

Thanks, but that didn't make a difference.
User avatar
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: no halt at matplotlib.pyplot.show()

Post by HarryvL »

This is the warning the package manager gives:

Screenshot from 2022-05-26 18-06-34.png
Screenshot from 2022-05-26 18-06-34.png (45.75 KiB) Viewed 800 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: no halt at matplotlib.pyplot.show()

Post by Kunda1 »

If you restart and type:

Code: Select all

Import matplotlib
What do you see?
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
HarryvL
Veteran
Posts: 1332
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: no halt at matplotlib.pyplot.show()

Post by HarryvL »

No errors:

Screenshot from 2022-05-27 08-09-22.png
Screenshot from 2022-05-27 08-09-22.png (21.42 KiB) Viewed 715 times
Post Reply