Napari & jupyter notebook issue

For some reason I can get napari to work with jupyter notebooks on two machines, but not on a third (the kernel dies).

It can be reproduced with:

gui qt5
import napari
napari.Viewer()

On a desktop and a laptop it works fine, but on a second laptop it fails. All machines are running Ubuntu 18.04 LTS, with napari 0.2.8 in a fresh conda environment and jupyter running in firefox. The only real difference is spec, but the laptop is still powerful enough.

Does anyone have any ideas why it’s only failing on one machine?

Hmm - it could be a finding of Qt bindings problem / a PySide2 vs PyQt5 problem. If you do %gui qt vs %gui qt5 does it make a difference? Sometimes even the fresh conda environment can have problems finding the right Qt stuff.

I take it you’re not seeing our napari requires a Qt event loop to run. error message, but just getting a kernel failure?

Also can you launch napari from the command line with just napari?

Also can you paste the output of napari --info into this thread.

Hi Nicholas,

napari --info just raised qt errors without printing information, same for launching napari from the command line.

I think I found the issue though. I’d always used conda install jupyter which seems to ship with an old version of PyQt5. pip install PyQt5 --upgrade solves the problem. Using conda install notebook still doesn’t work, but it at least gives a qt error.

My problem is fixed, but for your information, this seems weird:

On this machine, napari works fine:

napari: 0.2.8
Platform: Linux-4.18.2-041802-generic-x86_64-with-debian-buster-sid
Python: 3.7.5 (default, Oct 25 2019, 15:51:11)  [GCC 7.3.0]
Qt: 5.9.6
PyQt5: 5.9.2
VisPy: 0.6.4
NumPy: 1.18.0
SciPy: 1.4.1
scikit-image: 0.16.2
Dask: 2.9.1

GL version:  4.6.0 NVIDIA 418.67
MAX_TEXTURE_SIZE: 32768

On another machine, with everything nearly the same, napari fails, and won’t work until PyQt5 is updated:

napari: 0.2.8
Platform: Linux-4.15.0-1065-oem-x86_64-with-debian-buster-sid
Python: 3.7.5 (default, Oct 25 2019, 15:51:11)  [GCC 7.3.0]
Qt: 5.14.0
PyQt5: 5.14.0
VisPy: 0.6.4
NumPy: 1.18.0
SciPy: 1.4.1
scikit-image: 0.16.2
Dask: 2.9.1

GL version:  3.0 Mesa 18.2.8
MAX_TEXTURE_SIZE: 16384

The only differences seem to be the linux version (although both are Ubuntu 18.04 LTS) and the GL version.

Thanks for your help!

Hmm, ok - glad it works now. We should look into this more. In theory you should be able to have used with the PySide2 that we depend on (but you may have to call that with %gui qt. We should improve some of this stuff though so this is less of an issue

%gui qt also didn’t work. What’s weird is that rather than list available qt bindings (which jupyter normally does if it can’t find one), the kernel just died.

Let me know if I can help with any testing, and thanks again for your help.

1 Like

Can you paste the output of conda list From the broken environment, and the full error you get?

Hi Talley,

I reproduced the problem with:

conda create --name naparitest python=3.6 jupyter nb_conda
conda activate naparitest
pip install napari

On one machine, napari gives a warning, but works fine. napari --info prints:

(naparitest) adam@pingu:~$ napari --info
/home/adam/miniconda3/envs/naparitest/lib/python3.6/site-packages/napari/__init__.py:27: UserWarning: 
    napari was tested with QT library `>=5.12.3`.
    The version installed is 5.9.6. Please report any issues with this
    specific QT version at https://github.com/Napari/napari/issues.
    
  warn(message=warn_message)
napari: 0.2.8
Platform: Linux-4.15.0-48-generic-x86_64-with-debian-buster-sid
Python: 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)  [GCC 7.3.0]
Qt: 5.9.6
PyQt5: 5.9.2
VisPy: 0.6.4
NumPy: 1.18.0
SciPy: 1.4.1
scikit-image: 0.16.2
Dask: 2.9.1

GL version:  4.6.0 NVIDIA 418.56
MAX_TEXTURE_SIZE: 32768

On the machine with the issue, napari --info gives:

(naparitest) adam@tigger:~/staging$ napari --info
/home/adam/miniconda3/envs/naparitest/lib/python3.6/site-packages/napari/__init__.py:27: UserWarning: 
    napari was tested with QT library `>=5.12.3`.
    The version installed is 5.9.6. Please report any issues with this
    specific QT version at https://github.com/Napari/napari/issues.
    
  warn(message=warn_message)
Segmentation fault (core dumped)

And the same error with just napari. When using jupyter notebooks, there are no additional errors, the kernel just dies.

conda list in the broken environment gives:

# packages in environment at /home/adam/miniconda3/envs/naparitest:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
alabaster                 0.7.12                   pypi_0    pypi
asciitree                 0.3.3                    pypi_0    pypi
attrs                     19.3.0                     py_0  
babel                     2.8.0                    pypi_0    pypi
backcall                  0.1.0                    py36_0  
bleach                    3.1.0                      py_0  
ca-certificates           2019.11.27                    0  
certifi                   2019.11.28               py36_0  
chardet                   3.0.4                    pypi_0    pypi
cycler                    0.10.0                   pypi_0    pypi
dask                      2.9.1                    pypi_0    pypi
dbus                      1.13.12              h746ee38_0  
decorator                 4.4.1                      py_0  
defusedxml                0.6.0                      py_0  
docutils                  0.15.2                   pypi_0    pypi
entrypoints               0.3                      py36_0  
expat                     2.2.6                he6710b0_0  
fasteners                 0.15                     pypi_0    pypi
fontconfig                2.13.0               h9420a91_0  
freetype                  2.9.1                h8a8886c_1  
freetype-py               2.1.0.post1              pypi_0    pypi
fsspec                    0.6.2                    pypi_0    pypi
glib                      2.63.1               h5a9c865_0  
gmp                       6.1.2                h6c8ec71_1  
gst-plugins-base          1.14.0               hbbd80ab_1  
gstreamer                 1.14.0               hb453b48_1  
icu                       58.2                 h9c2bf20_1  
idna                      2.8                      pypi_0    pypi
imageio                   2.6.1                    pypi_0    pypi
imagesize                 1.2.0                    pypi_0    pypi
importlib_metadata        1.3.0                    py36_0  
ipykernel                 5.1.3            py36h39e3cac_0  
ipython                   7.10.2           py36h39e3cac_0  
ipython_genutils          0.2.0                    py36_0  
ipywidgets                7.5.1                      py_0  
jedi                      0.15.1                   py36_0  
jinja2                    2.10.3                     py_0  
jpeg                      9b                   h024ee3a_2  
jsonschema                3.2.0                    py36_0  
jupyter                   1.0.0                    py36_7  
jupyter_client            5.3.4                    py36_0  
jupyter_console           6.0.0                    py36_0  
jupyter_core              4.6.1                    py36_0  
kiwisolver                1.1.0                    pypi_0    pypi
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libpng                    1.6.37               hbc83047_0  
libsodium                 1.0.16               h1bed415_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
libuuid                   1.0.3                h1bed415_2  
libxcb                    1.13                 h1bed415_1  
libxml2                   2.9.9                hea5a465_1  
markupsafe                1.1.1            py36h7b6447c_0  
matplotlib                3.1.2                    pypi_0    pypi
mistune                   0.8.4            py36h7b6447c_0  
monotonic                 1.5                      pypi_0    pypi
more-itertools            8.0.2                      py_0  
napari                    0.2.8                    pypi_0    pypi
nb_conda                  2.2.1                    py36_0  
nb_conda_kernels          2.2.2                    py36_0  
nbconvert                 5.6.1                    py36_0  
nbformat                  4.4.0                    py36_0  
ncurses                   6.1                  he6710b0_1  
networkx                  2.4                      pypi_0    pypi
notebook                  6.0.2                    py36_0  
numcodecs                 0.6.3                    pypi_0    pypi
numpy                     1.18.0                   pypi_0    pypi
numpydoc                  0.9.2                    pypi_0    pypi
openssl                   1.1.1d               h7b6447c_3  
packaging                 19.2                     pypi_0    pypi
pandoc                    2.2.3.2                       0  
pandocfilters             1.4.2                    py36_1  
parso                     0.5.2                      py_0  
pcre                      8.43                 he6710b0_0  
pexpect                   4.7.0                    py36_0  
pickleshare               0.7.5                    py36_0  
pillow                    7.0.0                    pypi_0    pypi
pip                       19.3.1                   py36_0  
prometheus_client         0.7.1                      py_0  
prompt_toolkit            2.0.10                     py_0  
ptyprocess                0.6.0                    py36_0  
pygments                  2.5.2                      py_0  
pyopengl                  3.1.4                    pypi_0    pypi
pyparsing                 2.4.6                    pypi_0    pypi
pyqt                      5.9.2            py36h05f1152_2  
pyrsistent                0.15.6           py36h7b6447c_0  
pyside2                   5.14.0                   pypi_0    pypi
python                    3.6.9                h265db76_0  
python-dateutil           2.8.1                      py_0  
pytz                      2019.3                   pypi_0    pypi
pywavelets                1.1.1                    pypi_0    pypi
pyzmq                     18.1.0           py36he6710b0_0  
qt                        5.9.7                h5867ecd_1  
qtconsole                 4.6.0                      py_0  
qtpy                      1.9.0                    pypi_0    pypi
readline                  7.0                  h7b6447c_5  
requests                  2.22.0                   pypi_0    pypi
scikit-image              0.16.2                   pypi_0    pypi
scipy                     1.4.1                    pypi_0    pypi
send2trash                1.5.0                    py36_0  
setuptools                42.0.2                   py36_0  
shiboken2                 5.14.0                   pypi_0    pypi
sip                       4.19.8           py36hf484d3e_0  
six                       1.13.0                   py36_0  
snowballstemmer           2.0.0                    pypi_0    pypi
sphinx                    2.3.1                    pypi_0    pypi
sphinxcontrib-applehelp   1.0.1                    pypi_0    pypi
sphinxcontrib-devhelp     1.0.1                    pypi_0    pypi
sphinxcontrib-htmlhelp    1.0.2                    pypi_0    pypi
sphinxcontrib-jsmath      1.0.1                    pypi_0    pypi
sphinxcontrib-qthelp      1.0.2                    pypi_0    pypi
sphinxcontrib-serializinghtml 1.1.3                    pypi_0    pypi
sqlite                    3.30.1               h7b6447c_0  
terminado                 0.8.3                    py36_0  
testpath                  0.4.4                      py_0  
tk                        8.6.8                hbc83047_0  
toolz                     0.10.0                   pypi_0    pypi
tornado                   6.0.3            py36h7b6447c_0  
traitlets                 4.3.3                    py36_0  
urllib3                   1.25.7                   pypi_0    pypi
vispy                     0.6.4                    pypi_0    pypi
wcwidth                   0.1.7                    py36_0  
webencodings              0.5.1                    py36_1  
wheel                     0.33.6                   py36_0  
widgetsnbextension        3.5.1                    py36_0  
wrapt                     1.11.2                   pypi_0    pypi
xz                        5.2.4                h14c3975_4  
zarr                      2.3.2                    pypi_0    pypi
zeromq                    4.3.1                he6710b0_3  
zipp                      0.6.0                      py_0  
zlib                      1.2.11               h7b6447c_3  

I can’t seem to reproduce the issue with needing to update PyQt if installing jupyter notebooks with conda install notebook, so I guess the only issue is with napari not working in an environment with jupyter notebooks installed via conda install jupyter, but that seems to not be the official way anyway. Strange that I can only reproduce this on one machine of three.

I’m experiencing the same issue on my Ubuntu desktop. Here is my napari --info output:

napari: 0.2.12
Platform: Linux-4.15.0-91-generic-x86_64-with-debian-buster-sid
Python: 3.7.3 (default, Mar 27 2019, 22:11:17)  [GCC 7.3.0]
Qt: 5.14.1
PyQt5: 5.14.1
VisPy: 0.6.4
NumPy: 1.17.4
SciPy: 1.3.2
scikit-image: 0.15.0
Dask: 2.9.0

GL version:  3.1 Mesa 19.2.8
MAX_TEXTURE_SIZE: 8192

hey tae! can you just restate the problem as you’re seeing it please? it basically works from the command line and within ipython, but not in jupyter notebooks? can you tell me more about your environment (conda list and pip freeze) along with some basic steps i can follow to try to reproduce it (e.g. environment creation and how you’re starting napari when it fails)

Hey Talley! Thanks for trying to reproduce and resolve this issue. it does not work from the command line and within ipython, nor does in jupyter notebook. Within ipython, the error looks like:

Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import napari                                                           

In [2]: from skimage import data                                                

In [3]: %gui qt                                                                 

In [4]: viewer = napari.view_image(data.astronaut(), rgb=True)                  
Stack dump:
Segmentation fault (core dumped)

In jupyter notebook, kernel dies when running napari.view_image(). Here is the conda list (sorry it’s base environment so kinda long…)

# Name                    Version                   Build  Channel
_anaconda_depends         2019.03                  py37_0  
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
_libgcc_mutex             0.1                        main  
_tflow_select             2.1.0                       gpu  
absl-py                   0.8.1                    py37_0  
adjusttext                0.7.2              pyh39e3cac_0    phlya
alabaster                 0.7.12                   py37_0  
anaconda                  custom                   py37_1  
anaconda-client           1.7.2                    py37_0  
anaconda-navigator        1.9.2                    py37_0  
anaconda-project          0.8.4                      py_0  
apbs                      1.5                  h14c3975_3    schrodinger
appdirs                   1.4.3            py37h28b3542_0  
apptools                  4.4.0                    pypi_0    pypi
argh                      0.26.2                   py37_0  
asn1crypto                1.3.0                    py37_0  
astor                     0.8.0                    py37_0  
astroid                   2.3.3                    py37_0  
astropy                   3.2.3            py37h7b6447c_0  
atomicwrites              1.3.0                    py37_1  
attrs                     19.3.0                     py_0  
automat                   0.8.0                      py_0  
autopep8                  1.4.4                      py_0  
babel                     2.8.0                      py_0  
backcall                  0.1.0                    py37_0  
backports                 1.0                        py_2  
backports.os              0.1.1                    py37_0  
backports.shutil_get_terminal_size 1.0.0                    py37_2  
bcrypt                    3.1.7            py37h7b6447c_0  
beautifulsoup4            4.8.2                    py37_0  
bitarray                  1.2.1            py37h7b6447c_0  
bkcharts                  0.2                      py37_0  
blas                      1.0                         mkl  
blaze                     0.11.3                   py37_0  
bleach                    3.1.0                    py37_0  
blosc                     1.16.3               hd408876_0  
bokeh                     1.4.0                    py37_0  
boto                      2.49.0                   py37_0  
boto3                     1.9.134                  pypi_0    pypi
botocore                  1.12.134                 pypi_0    pypi
bottleneck                1.3.1            py37hdd07704_0  
bzip2                     1.0.8                h7b6447c_0  
c-ares                    1.15.0            h7b6447c_1001  
ca-certificates           2019.11.28           hecc5488_0    conda-forge
cairo                     1.14.12              h8948797_3  
certifi                   2019.11.28       py37hc8dfbb8_1    conda-forge
cffi                      1.14.0                   pypi_0    pypi
chardet                   3.0.4                 py37_1003  
click                     7.0                      py37_0  
cloudpickle               1.2.2                      py_0  
clyent                    1.2.2                    py37_1  
colorama                  0.4.3                      py_0  
conda                     4.8.3            py37hc8dfbb8_0    conda-forge
conda-build               3.15.1                   py37_0  
conda-env                 2.6.0                         1  
conda-package-handling    1.6.0            py37h7b6447c_0  
configobj                 5.0.6                    pypi_0    pypi
configparser              4.0.2                    pypi_0    pypi
constantly                15.1.0           py37h28b3542_0  
contextlib2               0.6.0.post1                py_0  
cryptography              2.8              py37h1ba5d50_0  
cudatoolkit               10.0.130                      0  
cudnn                     7.6.5                cuda10.0_0  
cupti                     10.0.130                      0  
curl                      7.67.0               hbc83047_0  
cycler                    0.10.0                   py37_0  
cython                    0.29.6                   pypi_0    pypi
cytoolz                   0.10.1           py37h7b6447c_0  
dask                      2.9.0                      py_0  
dask-core                 2.9.0                      py_0  
datashape                 0.5.4                    py37_1  
dbus                      1.13.12              h746ee38_0  
decorator                 4.4.1                      py_0  
defusedxml                0.6.0                      py_0  
diff-match-patch          20181111                   py_0  
distributed               2.10.0                     py_0  
docutils                  0.16                     py37_0  
entrypoints               0.3                      py37_0  
envisage                  4.7.2                    pypi_0    pypi
et_xmlfile                1.0.1                    py37_0  
expat                     2.2.6                he6710b0_0  
fastcache                 1.1.0            py37h7b6447c_0  
filelock                  3.0.12                     py_0  
flake8                    3.7.9                    py37_0  
flask                     1.1.1                      py_0  
flask-cors                3.0.8                      py_0  
fontconfig                2.13.0               h9420a91_0  
freemol                   1.158                    py37_1    schrodinger
freetype                  2.9.1                h8a8886c_1  
freetype-py               2.1.0.post1              pypi_0    pypi
fribidi                   1.0.5                h7b6447c_0  
fsspec                    0.6.2                      py_0  
funcsigs                  1.0.2                    pypi_0    pypi
future                    0.17.1                   pypi_0    pypi
gast                      0.2.2                    py37_0  
get_terminal_size         1.0.0                haa9412d_0  
gevent                    1.4.0            py37h7b6447c_0  
glew                      2.0.0                         0    schrodinger
glib                      2.63.1               h5a9c865_0  
glob2                     0.7                        py_0  
gmp                       6.1.2                h6c8ec71_1  
gmpy2                     2.0.8            py37h10f8cd9_2  
google-pasta              0.1.8                      py_0  
graphite2                 1.3.13               h23475e2_0  
greenlet                  0.4.15           py37h7b6447c_0  
grpcio                    1.16.1           py37hf8bcb03_1  
gst-plugins-base          1.14.0               hbbd80ab_1  
gstreamer                 1.14.0               hb453b48_1  
h5py                      2.8.0            py37h989c5e5_3  
harfbuzz                  1.8.8                hffaf4a1_0  
hdf5                      1.10.2               hba1933b_1  
heapdict                  1.0.1                      py_0  
html5lib                  1.0.1                    py37_0  
hyperlink                 19.0.0                     py_0  
hypothesis                4.54.2                   py37_0  
icu                       58.2                 h9c2bf20_1  
idna                      2.8                      py37_0  
imageio                   2.6.1                    py37_0  
imagej                    0.3.1                    pypi_0    pypi
imagesize                 1.2.0                      py_0  
importlib_metadata        1.4.0                    py37_0  
imreg-dft                 2.0.0                    pypi_0    pypi
incremental               17.5.0                   py37_0  
intel-openmp              2019.4                      243  
intervaltree              3.0.2                      py_0  
ipykernel                 5.1.4            py37h39e3cac_0  
ipython                   7.13.0                   pypi_0    pypi
ipython_genutils          0.2.0                    py37_0  
ipywidgets                7.5.1                      py_0  
isort                     4.3.21                   py37_0  
itsdangerous              1.1.0                    py37_0  
javabridge                1.0.18                   pypi_0    pypi
jbig                      2.1                  hdba287a_0  
jdcal                     1.4.1                      py_0  
jedi                      0.15.2                   py37_0  
jeepney                   0.4.2                      py_0  
jinja2                    2.10.3                     py_0  
jmespath                  0.9.4                    pypi_0    pypi
joblib                    0.14.1                     py_0  
jpeg                      9b                   h024ee3a_2  
json5                     0.8.5                      py_0  
jsonschema                3.2.0                    py37_0  
jupyter                   1.0.0                    py37_7  
jupyter_client            5.3.4                    py37_0  
jupyter_console           5.2.0                    py37_1  
jupyter_core              4.6.1                    py37_0  
jupyterlab                1.0.6                    py37_0    conda-forge
jupyterlab_launcher       0.13.1                   py37_0  
jupyterlab_server         1.0.6                      py_0  
keras-applications        1.0.8                      py_0  
keras-preprocessing       1.1.0                      py_1  
keyring                   21.1.0                   py37_0  
kiwisolver                1.1.0            py37he6710b0_0  
krb5                      1.16.4               h173b8e3_0  
lazy-object-proxy         1.4.3            py37h7b6447c_0  
libarchive                3.3.3                h5d8350f_5  
libcurl                   7.67.0               h20c2e04_0  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libglu                    9.0.0                hf484d3e_1  
libhwloc                  2.0.3                h3c4fd83_1    conda-forge
liblief                   0.9.0                h7725739_2  
libopenblas               0.3.6                h5a2b251_2  
libpng                    1.6.37               hbc83047_0  
libprotobuf               3.11.2               hd408876_0  
libsodium                 1.0.16               h1bed415_0  
libspatialindex           1.9.3                he6710b0_0  
libssh2                   1.8.2                h1ba5d50_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtiff                   4.1.0                h2733197_0  
libtool                   2.4.6                h7b6447c_5  
libuuid                   1.0.3                h1bed415_2  
libxcb                    1.13                 h1bed415_1  
libxml2                   2.9.9                hea5a465_1  
libxslt                   1.1.33               h7d1a2b0_0  
llvmlite                  0.30.0           py37hd408876_0  
locket                    0.2.0                    py37_1  
lxml                      4.4.2            py37hefd8a0e_0  
lz4-c                     1.8.1.2              h14c3975_0  
lzo                       2.10                 h49e0be7_2  
mahotas                   1.4.5            py37hf8a1672_0    conda-forge
mako                      1.1.1                    pypi_0    pypi
markdown                  3.1.1                    py37_0  
markupsafe                1.1.1            py37h7b6447c_0  
matplotlib                3.1.1            py37h5429711_0  
mayavi                    4.6.2                    pypi_0    pypi
mccabe                    0.6.1                    py37_1  
mengine                   1                    h14c3975_1    schrodinger
mistune                   0.8.4            py37h7b6447c_0  
mkl                       2019.4                      243  
mkl-service               2.3.0            py37he904b0f_0  
mkl_fft                   1.0.15           py37ha843d7b_0  
mkl_random                1.1.0            py37hd6b4f25_0  
more-itertools            8.0.2                      py_0  
mpc                       1.1.0                h10f8cd9_1  
mpeg_encode               1                    h14c3975_1    schrodinger
mpfr                      4.0.1                hdf1c602_3  
mpmath                    1.1.0                    py37_0  
msgpack-python            0.6.1            py37hfd86e86_1  
mtz2ccp4_px               1.0                  h9ac9557_3    schrodinger
multipledispatch          0.6.0                    py37_0  
napari                    0.2.12                   pypi_0    pypi
navigator-updater         0.2.1                    py37_0  
nbconvert                 5.6.1                    py37_0  
nbformat                  5.0.4                      py_0  
ncurses                   6.1                  he6710b0_1  
nd2reader                 3.1.0                    pypi_0    pypi
networkx                  2.4                        py_0  
nltk                      3.4.5                    py37_0  
nose                      1.3.7                    py37_2  
notebook                  6.0.3                    py37_0  
numba                     0.46.0           py37h962f231_0  
numexpr                   2.7.1            py37h423224d_0  
numpy                     1.18.0                   pypi_0    pypi
numpy-base                1.17.4           py37hde5b4d6_0  
numpydoc                  0.9.2                      py_0  
ocl-icd                   2.2.12            h516909a_1005    conda-forge
ocl-icd-system            1.0.0                         1    conda-forge
oclgrind                  18.3              h29592fa_1002    conda-forge
odo                       0.5.1                    py37_0  
olefile                   0.46                     py37_0  
openpyxl                  3.0.3                      py_0  
openssl                   1.1.1d               h516909a_0    conda-forge
opt_einsum                3.1.0                      py_0  
packaging                 20.1                       py_0  
pandas                    0.25.3           py37he6710b0_0  
pandoc                    2.2.3.2                       0  
pandocfilters             1.4.2                    py37_1  
pango                     1.42.4               h049681c_0  
parso                     0.6.0                      py_0  
partd                     1.1.0                      py_0  
patchelf                  0.10                 he6710b0_0  
path                      13.1.0                   py37_0  
path.py                   12.4.0                        0  
pathlib2                  2.3.5                    py37_0  
pathtools                 0.1.2                      py_1  
patsy                     0.5.1                    py37_0  
pcre                      8.43                 he6710b0_0  
pdb2pqr                   2.1.1                    py37_1    schrodinger
pep8                      1.7.1                    py37_0  
pexpect                   4.8.0                    py37_0  
pickleshare               0.7.5                    py37_0  
pillow                    7.0.0            py37hb39fc2d_0  
pims                      0.4.1                      py_1    conda-forge
pims-nd2                  1.0                      pypi_0    pypi
pip                       19.1.1                   pypi_0    pypi
pixman                    0.38.0               h7b6447c_0  
pkginfo                   1.5.0.1                  py37_0  
pluggy                    0.13.1                   py37_0  
ply                       3.11                     py37_0  
pmw                       2.0.1                    py37_2    schrodinger
pocl                      1.4                  h7d38c80_0    conda-forge
prometheus_client         0.7.1                      py_0  
prompt-toolkit            3.0.4                    pypi_0    pypi
protobuf                  3.11.2           py37he6710b0_0  
psutil                    5.6.7            py37h7b6447c_0  
ptyprocess                0.6.0                    py37_0  
py                        1.8.1                      py_0  
py-lief                   0.9.0            py37h7725739_2  
pyasn1                    0.4.8                      py_0  
pyasn1-modules            0.2.7                      py_0  
pybind11                  2.4.3                    pypi_0    pypi
pycodestyle               2.5.0                    py37_0  
pycosat                   0.6.3            py37h7b6447c_0  
pycparser                 2.19                     py37_0  
pycrypto                  2.6.1            py37h14c3975_9  
pycurl                    7.43.0.4         py37h1ba5d50_0  
pydocstyle                4.0.1                      py_0  
pyface                    6.1.0                    pypi_0    pypi
pyflakes                  2.1.1                    py37_0  
pygments                  2.5.2                      py_0  
pyhamcrest                1.9.0                    py37_2  
pylint                    2.4.4                    py37_0  
pymol                     2.3.2            py37h75f9260_0    schrodinger
pympler                   0.7                        py_0  
pyodbc                    4.0.28           py37he6710b0_0  
pyopencl                  2019.1.2         py37h9de70de_0    conda-forge
pyopengl                  3.1.0                    pypi_0    pypi
pyopenssl                 19.1.0                   py37_0  
pyparsing                 2.4.6                      py_0  
pyqt                      5.9.2            py37h05f1152_2  
pyqt5                     5.14.1                   pypi_0    pypi
pyqt5-sip                 12.7.1                   pypi_0    pypi
pyrsistent                0.15.7           py37h7b6447c_0  
pyside2                   5.14.1                   pypi_0    pypi
pysocks                   1.7.1                    py37_0  
pytables                  3.4.4            py37ha205bf6_0  
pytest                    5.3.4                    py37_0  
pytest-arraydiff          0.3              py37h39e3cac_0  
pytest-astropy            0.7.0                      py_0  
pytest-astropy-header     0.1.1                      py_0  
pytest-doctestplus        0.5.0                      py_0  
pytest-openfiles          0.4.0                      py_0  
pytest-remotedata         0.3.2                    py37_0  
python                    3.7.3                h0371630_0  
python-bioformats         1.5.2                    pypi_0    pypi
python-dateutil           2.8.1                      py_0  
python-jsonrpc-server     0.3.2                      py_0  
python-language-server    0.31.2                   py37_0  
python-libarchive-c       2.8                     py37_13  
python_abi                3.7                     1_cp37m    conda-forge
pytools                   2020.1                     py_0    conda-forge
pytz                      2019.3                     py_0  
pywavelets                1.1.1            py37h7b6447c_0  
pyxdg                     0.26                       py_0  
pyyaml                    5.2              py37h7b6447c_0  
pyzmq                     18.0.0           py37he6710b0_0    anaconda
qdarkstyle                2.7                        py_0  
qt                        5.9.7                h5867ecd_1  
qtawesome                 0.6.1                      py_0  
qtconsole                 4.6.0                      py_1  
qtpy                      1.9.0                      py_0  
read-roi                  1.5.2                      py_0    conda-forge
readline                  7.0                  h7b6447c_5  
reikna                    0.7.4                    pypi_0    pypi
requests                  2.22.0                   py37_1  
rigimol                   1.3                           2    schrodinger
rope                      0.16.0                     py_0  
rtree                     0.8.3                    py37_0  
ruamel_yaml               0.15.87          py37h7b6447c_0  
s3transfer                0.2.0                    pypi_0    pypi
scikit-image              0.15.0           py37he6710b0_0  
scikit-learn              0.22.1           py37hd81dba3_0  
scikit-tensor-py3         0.4.1                    pypi_0    pypi
scipy                     1.3.2            py37h7c811a0_0  
seaborn                   0.9.0              pyh91ea838_1  
secretstorage             3.1.2                    py37_0  
send2trash                1.5.0                    py37_0  
service_identity          18.1.0           py37h28b3542_0  
setuptools                40.8.0                   pypi_0    pypi
shiboken2                 5.14.1                   pypi_0    pypi
simplegeneric             0.8.1                    py37_2  
singledispatch            3.4.0.3                  py37_0  
sip                       4.19.8           py37hf484d3e_0  
six                       1.14.0                   py37_0  
slicerator                1.0.0                      py_0    conda-forge
snappy                    1.1.7                hbae5bb6_3  
snowballstemmer           2.0.0                      py_0  
sortedcollections         1.1.2                    py37_0  
sortedcontainers          2.1.0                    py37_0  
soupsieve                 1.9.5                    py37_0  
sphinx                    2.3.1                      py_0  
sphinxcontrib             1.0                      py37_1  
sphinxcontrib-applehelp   1.0.1                      py_0  
sphinxcontrib-devhelp     1.0.1                      py_0  
sphinxcontrib-htmlhelp    1.0.2                      py_0  
sphinxcontrib-jsmath      1.0.1                      py_0  
sphinxcontrib-qthelp      1.0.2                      py_0  
sphinxcontrib-serializinghtml 1.1.3                      py_0  
sphinxcontrib-websupport  1.1.2                      py_0  
spyder                    3.3.6                    py37_0  
spyder-kernels            0.5.2                    py37_0  
sqlalchemy                1.3.13           py37h7b6447c_0  
sqlite                    3.30.1               h7b6447c_0  
statsmodels               0.10.1           py37hdd07704_0  
sympy                     1.5.1                    py37_0  
tbb                       2019.8               hfd86e86_0  
tblib                     1.6.0                      py_0  
tensorboard               2.0.0              pyhb38c66f_1  
tensorflow                2.0.0           gpu_py37h768510d_0  
tensorflow-base           2.0.0           gpu_py37h0ec5d1f_0  
tensorflow-estimator      2.0.0              pyh2649769_0  
tensorflow-gpu            2.0.0                h0d30ee6_0  
termcolor                 1.1.0                    py37_1  
terminado                 0.8.3                    py37_0  
testpath                  0.4.4                      py_0  
tifffile                  0.15.1          py37h3010b51_1001    conda-forge
tk                        8.6.8                hbc83047_0  
toolz                     0.10.0                     py_0  
tornado                   6.0.3            py37h7b6447c_0  
tqdm                      4.42.0                     py_0  
trackpy                   0.4.1                      py_1    conda-forge
traitlets                 4.3.3                    py37_0  
traits                    5.1.1                    pypi_0    pypi
traitsui                  6.1.0                    pypi_0    pypi
twisted                   19.10.0          py37h7b6447c_0  
ujson                     1.35             py37h14c3975_0  
unicodecsv                0.14.1                   py37_0  
unixodbc                  2.3.7                h14c3975_0  
urllib3                   1.25.8                   py37_0  
vispy                     0.6.4                    pypi_0    pypi
visvis                    1.11.2                   pypi_0    pypi
vtk                       8.1.2                    pypi_0    pypi
watchdog                  0.9.0                    py37_1  
wcwidth                   0.1.7                    py37_0  
webencodings              0.5.1                    py37_1  
werkzeug                  0.16.1                     py_0  
wheel                     0.34.1                   py37_0  
widgetsnbextension        3.5.1                    py37_0  
wrapt                     1.11.2           py37h7b6447c_0  
wurlitzer                 2.0.0                    py37_0  
xlrd                      1.2.0                    py37_0  
xlsxwriter                1.2.7                      py_0  
xlwt                      1.3.0                    py37_0  
xmltodict                 0.12.0                   pypi_0    pypi
xz                        5.2.4                h14c3975_4  
yaml                      0.1.7                had09818_2  
yapf                      0.28.0                     py_0  
zeromq                    4.3.1                he6710b0_3  
zict                      1.0.0                      py_0  
zipp                      0.6.0                      py_0  
zlib                      1.2.11               h7b6447c_3  
zope                      1.0                      py37_1  
zope.interface            4.7.1            py37h7b6447c_0  
zstd                      1.3.7                h0b5b093_0  

And pip freeze:

absl-py==0.8.1
adjustText==0.7.2
alabaster==0.7.12
anaconda-client==1.7.2
anaconda-navigator==1.9.2
anaconda-project==0.8.3
appdirs==1.4.3
apptools==4.4.0
argh==0.26.2
asn1crypto==1.3.0
astor==0.8.0
astroid==2.3.3
astropy==3.2.3
atomicwrites==1.3.0
attrs==19.3.0
Automat==0.8.0
autopep8==1.4.4
Babel==2.8.0
backcall==0.1.0
backports.os==0.1.1
backports.shutil-get-terminal-size==1.0.0
bcrypt==3.1.7
beautifulsoup4==4.8.2
bitarray==1.2.1
bkcharts==0.2
blaze==0.11.3
bleach==3.1.0
bokeh==1.4.0
boto==2.49.0
boto3==1.9.134
botocore==1.12.134
Bottleneck==1.3.1
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
Click==7.0
cloudpickle==1.2.2
clyent==1.2.2
colorama==0.4.3
conda==4.8.3
conda-build==3.15.1
conda-package-handling==1.6.0
configobj==5.0.6
configparser==4.0.2
constantly==15.1.0
contextlib2==0.6.0.post1
cryptography==2.8
cycler==0.10.0
Cython==0.29.14
cytoolz==0.10.1
dask==2.9.0
datashape==0.5.4
decorator==4.4.1
defusedxml==0.6.0
diff-match-patch==20181111
distributed==2.10.0
docutils==0.16
entrypoints==0.3
envisage==4.7.2
et-xmlfile==1.0.1
fastcache==1.1.0
filelock==3.0.12
flake8==3.7.9
Flask==1.1.1
Flask-Cors==3.0.8
freemol==1.158
freetype-py==2.1.0.post1
fsspec==0.6.2
funcsigs==1.0.2
future==0.18.2
gast==0.2.2
gevent==1.4.0
glob2==0.7
gmpy2==2.0.8
google-pasta==0.1.8
greenlet==0.4.15
grpcio==1.16.1
h5py==2.8.0
HeapDict==1.0.1
html5lib==1.0.1
hyperlink==19.0.0
hypothesis==4.54.2
idna==2.8
imageio==2.6.1
imagej==0.3.1
imagesize==1.2.0
importlib-metadata==1.4.0
imreg-dft==2.0.0
incremental==17.5.0
intervaltree==3.0.2
ipykernel==5.1.4
ipython==7.13.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==4.3.21
itsdangerous==1.1.0
javabridge==1.0.18
jdcal==1.4.1
jedi==0.15.2
jeepney==0.4.2
Jinja2==2.10.3
jmespath==0.9.4
joblib==0.14.1
json5==0.8.5
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==5.3.4
jupyter-console==5.2.0
jupyter-core==4.6.1
jupyterlab==1.0.6
jupyterlab-launcher==0.13.1
jupyterlab-server==1.0.6
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
keyring==21.1.0
kiwisolver==1.1.0
lazy-object-proxy==1.4.3
libarchive-c==2.8
lief==0.9.0
llvmlite==0.30.0
locket==0.2.0
lxml==4.4.2
mahotas==1.4.5
Mako==1.1.1
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.1.1
mayavi==4.6.2
mccabe==0.6.1
mistune==0.8.4
mkl-fft==1.0.15
mkl-random==1.1.0
mkl-service==2.3.0
more-itertools==8.0.2
mpmath==1.1.0
msgpack==0.6.1
multipledispatch==0.6.0
napari==0.2.12
navigator-updater==0.2.1
nbconvert==5.6.1
nbformat==5.0.4
nd2reader==3.1.0
networkx==2.4
nltk==3.4.5
nose==1.3.7
notebook==6.0.3
numba==0.46.0
numexpr==2.7.1
numpy==1.18.0
numpydoc==0.9.2
odo==0.5.1
olefile==0.46
openpyxl==3.0.3
opt-einsum==3.1.0
packaging==20.1
pandas==0.25.3
pandocfilters==1.4.2
parso==0.6.0
partd==1.1.0
path==13.1.0
pathlib2==2.3.5
pathtools==0.1.2
patsy==0.5.1
pdb2pqr-minimal==0.0.0
pep8==1.7.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.0.0
PIMS==0.4.1
pims-nd2==1.0
pkginfo==1.5.0.1
pluggy==0.13.1
ply==3.11
prometheus-client==0.7.1
prompt-toolkit==3.0.4
protobuf==3.11.2
psutil==5.6.7
ptyprocess==0.6.0
py==1.8.1
pyasn1==0.4.8
pyasn1-modules==0.2.7
pybind11==2.4.3
pycodestyle==2.5.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycurl==7.43.0.4
pydocstyle==4.0.1
pyface==6.1.0
pyflakes==2.1.1
Pygments==2.5.2
PyHamcrest==1.9.0
pylint==2.4.4
pymol==2.3.2
Pympler==0.7
pyodbc==4.0.28
pyopencl==2019.1.2
PyOpenGL==3.1.0
pyOpenSSL==19.1.0
pyparsing==2.4.6
PyQt5==5.14.1
PyQt5-sip==12.7.1
pyrsistent==0.15.7
PySide2==5.14.1
PySocks==1.7.1
pytest==5.3.4
pytest-arraydiff==0.3
pytest-astropy==0.7.0
pytest-astropy-header==0.1.1
pytest-doctestplus==0.5.0
pytest-openfiles==0.4.0
pytest-remotedata==0.3.2
python-bioformats==1.5.2
python-dateutil==2.8.1
python-jsonrpc-server==0.3.2
python-language-server==0.31.2
pytools==2020.1
pytz==2019.3
PyWavelets==1.1.1
pyxdg==0.26
PyYAML==5.2
pyzmq==18.0.0
QDarkStyle==2.7
QtAwesome==0.6.1
qtconsole==4.6.0
QtPy==1.9.0
read-roi==1.5.2
reikna==0.7.4
requests==2.22.0
rope==0.16.0
Rtree==0.8.3
ruamel-yaml==0.15.87
s3transfer==0.2.0
scikit-image==0.15.0
scikit-learn==0.22.1
scikit-tensor-py3==0.4.1
scipy==1.3.2
seaborn==0.9.0
SecretStorage==3.1.2
Send2Trash==1.5.0
service-identity==18.1.0
shiboken2==5.14.1
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.14.0
slicerator==1.0.0
snowballstemmer==2.0.0
sortedcollections==1.1.2
sortedcontainers==2.1.0
soupsieve==1.9.5
Sphinx==2.3.1
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sphinxcontrib-websupport==1.1.2
spyder==3.3.6
spyder-kernels==0.5.2
SQLAlchemy==1.3.13
statsmodels==0.10.1
sympy==1.5.1
tables==3.4.4
tblib==1.6.0
tensorboard==2.0.0
tensorflow==2.0.0
tensorflow-estimator==2.0.0
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
tifffile==0.15.1
toolz==0.10.0
tornado==6.0.3
tqdm==4.42.0
trackpy==0.4.1
traitlets==4.3.3
traits==5.1.1
traitsui==6.1.0
Twisted==19.10.0
ujson==1.35
unicodecsv==0.14.1
urllib3==1.25.8
vispy==0.6.4
visvis==1.11.2
vtk==8.1.2
watchdog==0.9.0
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.16.1
widgetsnbextension==3.5.1
wrapt==1.11.2
wurlitzer==2.0.0
xlrd==1.2.0
XlsxWriter==1.2.7
xlwt==1.3.0
xmltodict==0.12.0
yapf==0.28.0
zict==1.0.0
zipp==0.6.0
zope.interface==4.7.1

thanks, and if you could test one more thing… just to make sure this has something to do with your python environment, can you make a clean one and test it?

conda create -n testenv -y python=3.7.3
conda activate testenv
pip install napari
ipython --gui=qt

>>> import napari
>>> from skimage import data
>>>viewer = napari.view_image(data.astronaut(), rgb=True)

my guess is that there’s something conflicting with all of those packages in that environment, but we’ll need to narrow it down somehow. might have something to do with multiple qt installations (you have both pyqt5 from conda and pyside2 from pip)… I’ll see what I can figure out.

1 Like

It works with the new virtual environment! Thanks :slight_smile:

Great, thanks for checking. It’s always tough to debug in the base environment… but we’ll see what we can figure out

2 Likes

well, unfortunately (for the purposes of debugging this), I just installed anaconda into a new location on my ubuntu desktop, and then, in the base environment, ran pip install napari. It worked fine. I then tried to install as many things from your environment that I could that seemed like they might potentially conflict with each other (for instance, you have pyqt==5.9.2, pyqt5==5.14.1 and pyside2==5.14.1 from both pip and conda) but even after replicating that, it still works for me.

There are some things I can’t replicate because of conda dependency conflicts, but here’s what I ended up with:

napari: 0.2.12
Platform: Linux-5.3.0-42-generic-x86_64-with-debian-buster-sid
Python: 3.7.6 (default, Jan  8 2020, 19:59:22)  [GCC 7.3.0]
Qt: 5.14.1
PyQt5: 5.14.1
VisPy: 0.6.4
NumPy: 1.18.1
SciPy: 1.4.1
scikit-image: 0.16.2
Dask: 2.11.0

GL version:  4.6.0 NVIDIA 440.64
MAX_TEXTURE_SIZE: 32768

couple notable differences in there: numpy, scipy, skimage, dask… but who knows.

The truth of the matter here is that it’s just really hard to debug these sorts of environmental problems when the base environment is used as a “kitchen sink”. I know it’s a bit of a cop-out, but it is strongly recommend to build distinct environments for various tasks. you can have a second “sink” environment where you try to install everything you want to use… and if eventually you install something that breaks something else, you can either remove it, or nuke the environment and start again. (That’s much harder to do with your base environment).

Since I can’t reproduce this on my linux computer, and it works for you in a clean environment, I’m afraid this may just have to remain unsolved for now. If you can eventually figure out a reproducible environment that gives you the segfault, I’m happy to look closer at what might be causing it.

Hi @talley

After the gorgeous presentation of napari by @sofroniewn yesterday, I decided to make napari work for my tasks. It works nicely if I start it on my home/office computer. However my main interest would be to use it on remote servers.

I am experiencing similar issue as @taebongwith trying to run napari at the remote server and connecting to it via ssh. I decided not to create a new forum thread because I have similar errors so I would appreciate your ideas.

So, my inputs:
I have anaconda installed at the remote server. The server normally supports graphics through ssh -X.

I created a new environment how @talley recommended, i.e with:
conda create -n testenv -y python=3.7.3

so it looks like:

# packages in environment at /mx-beta/anaconda3/envs/naparienv:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
alabaster                 0.7.12                    <pip>
attrs                     19.3.0                    <pip>
Babel                     2.8.0                     <pip>
backcall                  0.1.0                     <pip>
bleach                    3.1.5                     <pip>
ca-certificates           2020.1.1                      0
cachey                    0.2.1                     <pip>
certifi                   2020.4.5.1               py37_0
chardet                   3.0.4                     <pip>
cycler                    0.10.0                    <pip>
dask                      2.17.2                    <pip>
decorator                 4.4.2                     <pip>
defusedxml                0.6.0                     <pip>
docutils                  0.16                      <pip>
entrypoints               0.3                       <pip>
freetype-py               2.1.0.post1               <pip>
HeapDict                  1.0.1                     <pip>
idna                      2.9                       <pip>
imageio                   2.8.0                     <pip>
imagesize                 1.2.0                     <pip>
importlib-metadata        1.6.0                     <pip>
ipykernel                 5.3.0                     <pip>
ipython                   7.15.0                    <pip>
ipython-genutils          0.2.0                     <pip>
jedi                      0.17.0                    <pip>
Jinja2                    2.11.2                    <pip>
jsonschema                3.2.0                     <pip>
jupyter-client            6.1.3                     <pip>
jupyter-core              4.6.3                     <pip>
kiwisolver                1.2.0                     <pip>
libedit                   3.1.20181209         hc058e9b_0
libffi                    3.2.1                hd88cf55_4
libgcc-ng                 9.1.0                hdf63c60_0
libstdcxx-ng              9.1.0                hdf63c60_0
MarkupSafe                1.1.1                     <pip>
matplotlib                3.2.1                     <pip>
mistune                   0.8.4                     <pip>
napari                    0.3.4                     <pip>
napari-plugin-engine      0.1.5                     <pip>
napari-svg                0.1.3                     <pip>
nbconvert                 5.6.1                     <pip>
nbformat                  5.0.6                     <pip>
ncurses                   6.2                  he6710b0_1
networkx                  2.4                       <pip>
notebook                  6.0.3                     <pip>
numpy                     1.18.5                    <pip>
numpydoc                  1.0.0                     <pip>
openssl                   1.1.1g               h7b6447c_0
packaging                 20.4                      <pip>
pandocfilters             1.4.2                     <pip>
parso                     0.7.0                     <pip>
pexpect                   4.8.0                     <pip>
pickleshare               0.7.5                     <pip>
Pillow                    7.1.2                     <pip>
pip                       20.0.2                   py37_3
prometheus-client         0.8.0                     <pip>
prompt-toolkit            3.0.5                     <pip>
psutil                    5.7.0                     <pip>
ptyprocess                0.6.0                     <pip>
Pygments                  2.6.1                     <pip>
PyOpenGL                  3.1.5                     <pip>
pyparsing                 2.4.7                     <pip>
PyQt5                     5.14.2                    <pip>
PyQt5-sip                 12.8.0                    <pip>
pyrsistent                0.16.0                    <pip>
python                    3.7.3                h0371630_0
python-dateutil           2.8.1                     <pip>
pytz                      2020.1                    <pip>
PyWavelets                1.1.1                     <pip>
PyYAML                    5.3.1                     <pip>
pyzmq                     19.0.1                    <pip>
qtconsole                 4.7.4                     <pip>
QtPy                      1.9.0                     <pip>
readline                  7.0                  h7b6447c_5
requests                  2.23.0                    <pip>
scikit-image              0.17.2                    <pip>
scipy                     1.4.1                     <pip>
Send2Trash                1.5.0                     <pip>
setuptools                47.1.1                   py37_0
six                       1.15.0                    <pip>
snowballstemmer           2.0.0                     <pip>
Sphinx                    3.0.4                     <pip>
sphinxcontrib-applehelp   1.0.2                     <pip>
sphinxcontrib-devhelp     1.0.2                     <pip>
sphinxcontrib-htmlhelp    1.0.3                     <pip>
sphinxcontrib-jsmath      1.0.1                     <pip>
sphinxcontrib-qthelp      1.0.3                     <pip>
sphinxcontrib-serializinghtml 1.1.4                     <pip>
sqlite                    3.31.1               h62c20be_1
terminado                 0.8.3                     <pip>
testpath                  0.4.4                     <pip>
tifffile                  2020.6.3                  <pip>
tk                        8.6.8                hbc83047_0
toolz                     0.10.0                    <pip>
tornado                   6.0.4                     <pip>
traitlets                 4.3.3                     <pip>
urllib3                   1.25.9                    <pip>
vispy                     0.6.4                     <pip>
wcwidth                   0.2.3                     <pip>
webencodings              0.5.1                     <pip>
wheel                     0.34.2                   py37_0
wrapt                     1.12.1                    <pip>
xz                        5.2.5                h7b6447c_0
zipp                      3.1.0                     <pip>
zlib                      1.2.11               h7b6447c_3

Then,

ipython --gui=qt

>>> import napari
>>> from skimage import data

works fine.

>>>viewer = napari.view_image(data.astronaut(), rgb=True)

raises an error:

RuntimeError: napari requires a Qt event loop to run. To create one, try one of the following:
  - use the `napari.gui_qt()` context manager. See https://github.com/napari/napari/tree/master/examples for usage examples.
  - In IPython or a local Jupyter instance, use the `%gui qt` magic command.
  - Launch IPython with the option `--gui=qt`.
  - (recommended) in your IPython configuration file, add or uncomment the line `c.TerminalIPythonApp.gui = 'qt'`. Then, restart IPython.

Then, If I do:
napari --info

I get:

WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found.
WARNING:vispy: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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

WARNING:vispy: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, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted (core dumped)

I am wondering if the problem is due to napari or due to the fact that I try to ssh -X it and something breaks on the way?

Also, my final goal is to use napari through establishing remote notebook server as described here:
https://amber-md.github.io/pytraj/latest/tutorials/remote_jupyter_notebook
This works fine for standard notebook-inline graphics.

However, trying to set napari, the kernel just dies after
%gui qt
Do you have any ideas?

1 Like

is the problem is due to napari or due to the fact that I try to ssh -X it and something breaks on the way?

it’s due to the ssh. Because vispy (the rendering engine behind napari) uses OpenGL hardware acceleration, simple X forwarding isn’t going to work. (see #799)

I’m definitely not an expert on this, so maybe there are others here who have experience forwarding frame buffers from openGL programs running remotely. At least one solution, if you can set it up, is to use VirtualGL and run napari remotely with vglrun napari.

hah… in fact, I can see that I commented on #869 that I apparently got this to work, and promised a writeup… which I never got to! I’ll try to work my way through it again and write up a tutorial. But if you get it running in the meantime, please let us know any tips!

2 Likes

actually… rereading your post: if you can’t even get a Qt app to start, you may have some missing drivers on your remote server. (libxcb?). See this thread for some debugging tips there (mostly: use the export QT_DEBUG_PLUGINS=1 environment varialbe before starting a qt app).

You will still need the virtualGL stuff above for it to ultimately work, but you may need to solve this problem first before napari will even launch.

1 Like