jdegenstein / jmwright-CQ-Editor

Forked from jmwright/CQ-Editor
Apache License 2.0
25 stars 7 forks source link

Issues on wayland (and a workaround) #13

Open whiskerz777 opened 1 year ago

whiskerz777 commented 1 year ago

Hi,

Running wayland (sway) on arch linux.

This affects both the release package and the development package. When I run the CQ-editor.sh (or the binary directly) I get the following error:

Unable to import OpenGL.platform.egl.EGLPlatform: No module named 'OpenGL.platform.egl'
Traceback (most recent call last):
  File "run.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "cq_editor/__main__.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "cq_editor/main_window.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "cq_editor/widgets/editor.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "pyqtgraph/__init__.py", line 281, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "pyqtgraph/widgets/RawImageWidget.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "OpenGL/GL/__init__.py", line 3, in <module>
    # Copyright (c) 2009- Spyder Project Contributors and others (see LICENSE.txt)
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "OpenGL/error.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
  File "OpenGL/platform/__init__.py", line 56, in <module>
  File "OpenGL/platform/__init__.py", line 50, in _load
TypeError: 'NoneType' object is not callable
[58026] Failed to execute script 'run' due to unhandled exception!

From what I understand its referencing EGL because thats what wayland uses to avoid dependencies on X but I'm not really across the concepts here.

I can work around this by forcing it to use X instead of Wayland (via xwayland), this is what my CQ-editor.sh looks like now:

#!/bin/sh
QT_QPA_PLATFORM=xcb PYOPENGL_PLATFORM=x11 ./CQ-editor/CQ-editor

I also got the issue from #5 but just solved it by copying my system libstdc++.so.6 into the CQ-Editor subdirectory.

Not sure how easy this is to fix, but this workaround is pretty simple for anyone looking. Its worth me noting too that CadQuery/CQ-editor works fine for me without the wayland workaround (still need the libstdc workaround).

Thanks!

jdegenstein commented 1 year ago

Thank you for the detailed description of the issue. When you say that CadQuery/CQ-editor works without the wayland workaround, are you referring to to CadQuery/CQ-editor release 0.2?

At some point soon I plan to target Ubuntu-22.04 as the target for the static builds (which will probably make older linux distros no longer work with the static builds). Thank you for the workarounds as it might be necessary when I move from 20.04 -> 22.04.

whiskerz777 commented 1 year ago

Yeah thats right, I am referring to CadQuery/CQ-editor release 0.2, and looking now I can confirm that its running using the X protocol (via xwayland), not natively in wayland. Only difference is it does this automatically rather than needing me to set those variables.

I still need to perform a fix for libstdc++.so.6 on this release, but I realized I can just delete the file rather than replacing it with the libstdc++.so.6 from my system. Guess it finds the system file anyway.

Thanks!