Open ssugrim-kryptowire opened 1 year ago
This seems to be a well documented issue:
The root cause seems to be a missing qt plugin. This might not be resolvable in conda, this might require the host OS to install the deb package via apt.
The apt repo doesn't have a qt5-wayland as indicated in stack overlfow:
(seqexp) jsugrim@JSG:~/VMSHARED/src/markovExample$ apt search qt5-wayland
Sorting... Done
Full Text Search... Done
gambas3-gb-qt5-wayland/jammy 3.16.3-3 amd64
Gambas Qt5 Wayland component
Instead it seems that is is named qtwayland5:
(seqexp) jsugrim@JSG:~/VMSHARED/src/markovExample$ apt search qtwayland5
Sorting... Done
Full Text Search... Done
qtwayland5/jammy 5.15.3-1 amd64
QtWayland platform plugin
However, installing this package did not fix the issue. Even specifying the platform variable did not resolve the problem:
(seqexp) jsugrim@JSG:~/VMSHARED/src/markovExample$ QT_QPA_PLATFORM=wayland python3 seq_exp.py
2023-06-05 13:28:12,560 - seq_exp.py - INFO - 111 case:
2023-06-05 13:28:16,998 - seq_exp.py - INFO - [3, 331.0, 783.0, 1522.0, 10680]
2023-06-05 13:28:16,998 - seq_exp.py - INFO - 121 case:
2023-06-05 13:28:20,926 - seq_exp.py - INFO - [3, 297.0, 712.5, 1398.0, 9469]
2023-06-05 13:28:20,926 - seq_exp.py - INFO - 123 case:
2023-06-05 13:28:24,736 - seq_exp.py - INFO - [3, 286.0, 678.0, 1352.0, 12485]
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.
After some searching on qt libs and random results, it turns out that the problem was with the code. The original code was written in spyder which does an auto draw of any figures created in the matplot lib library. Since the current version was being run in either vs code or from the command line, the code needed a plt.show() call to actually initiate the drawing. After adding that line the graph generation works (with wanings): | |
---|---|
Successful run with warnings. |
Several things were discovered while trying to resolve this issue:
eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.
MPLBACKEND=TkAgg python seq_exp.py
Other refs:
commit b2610f1 resolves the issue
When running the code in ubuntu 22.04 with the default desktop (wayland), @ssugrim-kryptowire gets the follow error:
This is due to matplotlib trying to open a window and is probably tied to some QT issues.