gerlichlab / looptrace

Fork (from EMBL Gitlab) of the looptrace project: https://git.embl.de/grp-ellenberg/looptrace
MIT License
2 stars 1 forks source link

May need to run `napari` in "headless" mode in pipeline #278

Closed vreuter closed 3 months ago

vreuter commented 3 months ago

https://napari.org/stable/howtos/headless.html

vreuter commented 3 months ago

May additionally or alternatively want xvfb: https://packages.ubuntu.com/jammy/xvfb

vreuter commented 3 months ago

Indeed, we do....

Traceback (most recent call last):                                                                                                                │········
  File "/opt/conda/lib/python3.10/site-packages/napari/window.py", line 14, in <module>                                                           │········
    from napari._qt import Window                                                                                                                 │········
  File "/opt/conda/lib/python3.10/site-packages/napari/_qt/__init__.py", line 77, in <module>                                                     │········
    from napari._qt.qt_event_loop import get_app, gui_qt, quit_app, run                                                                           │········
  File "/opt/conda/lib/python3.10/site-packages/napari/_qt/qt_event_loop.py", line 11, in <module>                                                │········
    from qtpy.QtGui import QIcon                                                                                                                  │········
  File "/opt/conda/lib/python3.10/site-packages/qtpy/QtGui.py", line 57, in <module>                                                              │········
    from PyQt6 import QtGui                                                                                                                       │········
ImportError: libEGL.so.1: cannot open shared object file: No such file or directory                                                               │········
                                                                                                                                                  │········
The above exception was the direct cause of the following exception:                                                                              │········
                                                                                                                                                  │········
Traceback (most recent call last):                                                                                                                │········
  File "/looptrace/bin/cli/run_processing_pipeline.py", line 328, in <module>                                                                     │········
    main(sys.argv[1:])                                                                                                                            │········
  File "/looptrace/bin/cli/run_processing_pipeline.py", line 323, in main                                                                         │········
    pipeline.run(start_point=opts.start_point, stop_after=opts.stop_after)                                                                        │········
  File "/opt/conda/lib/python3.10/site-packages/pypiper/pipeline.py", line 319, in run                                                            │········
    stage.run()                                                                                                                                   │········
  File "/opt/conda/lib/python3.10/site-packages/pypiper/stage.py", line 56, in run                                                                │········
    self(*args, **kwargs)                                                                                                                         │········
  File "/opt/conda/lib/python3.10/site-packages/pypiper/stage.py", line 64, in __call__                                                           │········
    self.f(*args, **kwargs)                                                                                                                       │········
  File "/looptrace/bin/cli/nuc_label_qc.py", line 101, in workflow                                                                                │········
    save_screenshot(viewer=viewer, outfile=outfile)                                                                                               │········
  File "/opt/conda/lib/python3.10/site-packages/looptrace/napari_helpers.py", line 92, in save_screenshot                                         │········
    screenshot = add_screenshot(viewer, flash=flash, **kwargs)                                                                                    │········
  File "/opt/conda/lib/python3.10/site-packages/looptrace/napari_helpers.py", line 78, in add_screenshot                                          │········
    screenshot = viewer.screenshot(flash=flash, **kwargs)                                                                                         │········
  File "/opt/conda/lib/python3.10/site-packages/napari/viewer.py", line 129, in screenshot                                                        │········
    return self.window.screenshot(                                                                                                                │········
  File "/opt/conda/lib/python3.10/site-packages/napari/window.py", line 27, in __getattr__                                                        │········
    raise type(err)(                                                                                                                              │········
ImportError: An error occured when importing Qt dependencies.  Cannot show napari window.  See cause above                                        │········
vreuter commented 3 months ago

napari is being removed from the pipeline, and visualisation handled separately