scverse / napari-spatialdata

Interactive visualization of spatial omics data
https://spatialdata.scverse.org/projects/napari/en/latest/
BSD 3-Clause "New" or "Revised" License
41 stars 17 forks source link

WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found. #331

Open zhouzhendiao opened 4 hours ago

zhouzhendiao commented 4 hours ago

Create a conda env:

conda create -y -n napari-env -c conda-forge python=3.9
conda activate napari-env
python -m pip install "napari-spatialdata[all]" "napari[all]" spatialdata_io jupyterlab 
python -m pip install spatialdata_io

I ran napari-spatialdata on docker image or conda env in a server. WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found. poped out, then the jupyter kernel restarted.

from spatialdata_io import xenium
sdata = xenium(folder)
sdata

output:

SpatialData object
├── Images
│     └── 'morphology_focus': DataTree[cyx] (5, 20658, 48379), (5, 10329, 24189), (5, 5164, 12094), (5, 2582, 6047), (5, 1291, 3023)
├── Labels
│     ├── 'cell_labels': DataTree[yx] (20658, 48379), (10329, 24189), (5164, 12094), (2582, 6047), (1291, 3023)
│     └── 'nucleus_labels': DataTree[yx] (20658, 48379), (10329, 24189), (5164, 12094), (2582, 6047), (1291, 3023)
├── Points
│     └── 'transcripts': DataFrame with shape: (<Delayed>, 13) (3D points)
├── Shapes
│     ├── 'cell_boundaries': GeoDataFrame shape: (203028, 1) (2D shapes)
│     ├── 'cell_circles': GeoDataFrame shape: (203028, 2) (2D shapes)
│     └── 'nucleus_boundaries': GeoDataFrame shape: (199737, 1) (2D shapes)
└── Tables
      └── 'table': AnnData (203028, 5001)
with coordinate systems:
    ▸ 'global', with elements:
        morphology_focus (Images), cell_labels (Labels), nucleus_labels (Labels), transcripts (Points), cell_boundaries (Shapes), cell_circles (Shapes), nucleus_boundaries (Shapes)
from napari_spatialdata import Interactive
interactive = Interactive(sdata)
interactive.run()

output:

WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found.
WARNING: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, webgl, xcb.

Didn't work out after several tries.Is it possible using this napari-spatialdata in linux server and how to?

melonora commented 2 hours ago

There are ways, but they can be difficult to setup, see https://github.com/napari/napari/issues/1457 for example. Do you think you would be able to follow some of the things mentioned here for debugging?

melonora commented 2 hours ago

Please also see: https://forum.image.sc/t/error-running-napari-on-hpc-could-not-load-qt-platform-plugins/92012/4