napari: Napari crash on Windows 10 - QT issue?

๐Ÿ› Bug

Hi all,

Iโ€™m a napari beginner and struggle in getting it to work on my Windows machine. It crashes while doing rather simple stuff

To Reproduce

Steps to reproduce the behavior:

  1. I installed napari using pip install napari and conda install napari
  2. I run this code in a python file:
import numpy as np
import napari

result = np.asarray([0, 1, 2, 3])

with napari.gui_qt():
    viewer = napari.Viewer()
    viewer.add_image(result);

This error pops up:

Traceback (most recent call last):
  File "C:\Users\rober\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\rober\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\rober\Anaconda3\lib\site-packages\PyQt5\pyrcc_main.py", line 23, in <module>
    from .pyrcc import *
ImportError: DLL load failed: The specified procedure could not be found.
Traceback (most recent call last):
  File "te_oki.py", line 2, in <module>
    import napari
  File "C:\Users\rober\Anaconda3\envs\cle\lib\site-packages\napari\__init__.py", line 56, in <module>
    from .viewer import Viewer
  File "C:\Users\rober\Anaconda3\envs\cle\lib\site-packages\napari\viewer.py", line 8, in <module>
    from ._qt.qt_main_window import Window
  File "C:\Users\rober\Anaconda3\envs\cle\lib\site-packages\napari\_qt\__init__.py", line 5, in <module>
    import_resources()
  File "C:\Users\rober\Anaconda3\envs\cle\lib\site-packages\napari\resources\__init__.py", line 119, in import_resources
    respath = build_pyqt_resources(fspath(target_file), overwrite=overwrite)
  File "C:\Users\rober\Anaconda3\envs\cle\lib\site-packages\napari\resources\build_icons.py", line 211, in build_pyqt_resources
    check_call([_find_rcc_or_raise(), '-o', out_path, qrc_path])
  File "C:\Users\rober\Anaconda3\envs\cle\lib\subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\rober\\Anaconda3\\Library\\bin\\pyrcc5.BAT', '-o', 'C:\\Users\\rober\\Anaconda3\\envs\\cle\\lib\\site-packages\\napari\\resources\\_qt_resources_0.3.4_pyqt5_5.12.5.py',
 'C:\\Users\\rober\\Anaconda3\\envs\\cle\\lib\\site-packages\\napari\\resources\\res.qrc']' returned non-zero exit status 1.

Expected behavior

Would be nice to see a napari window ๐Ÿ˜ƒ

Environment

conda list:

# packages in environment at C:\Users\rober\Anaconda3\envs\cle:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.12                     py_0    conda-forge
appdirs                   1.4.4                    pypi_0    pypi
asciitree                 0.3.3                      py_2    conda-forge
attrs                     19.3.0                     py_0    conda-forge
babel                     2.8.0                      py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
bleach                    3.1.5              pyh9f0ad1d_0    conda-forge
bokeh                     2.0.1            py38h32f6830_0    conda-forge
brotlipy                  0.7.0           py38h1e8a9f7_1000    conda-forge
ca-certificates           2020.4.5.1           hecc5488_0    conda-forge
cachey                    0.2.1                    pypi_0    pypi
certifi                   2020.4.5.1       py38h32f6830_0    conda-forge
cffi                      1.14.0           py38ha419a9e_0    conda-forge
chardet                   3.0.4           py38h32f6830_1006    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
cloudpickle               1.4.1                      py_0    conda-forge
colorama                  0.4.3                      py_0    conda-forge
configparser              5.0.0                    pypi_0    pypi
cryptography              2.9.2            py38hba49e27_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cytoolz                   0.10.1           py38hfa6e2cd_0    conda-forge
dask                      2.17.2                     py_0    conda-forge
dask-core                 2.17.2                     py_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
distributed               2.17.0           py38h32f6830_0    conda-forge
docutils                  0.16             py38h32f6830_1    conda-forge
entrypoints               0.3             py38h32f6830_1001    conda-forge
fasteners                 0.14.1                     py_3    conda-forge
freetype                  2.10.2               hd328e21_0    conda-forge
freetype-py               2.1.0.post1                py_0    conda-forge
fsspec                    0.7.4                      py_0    conda-forge
funcsigs                  1.0.2                    pypi_0    pypi
gputools                  0.2.9                    pypi_0    pypi
heapdict                  1.0.1                      py_0    conda-forge
icc_rt                    2019.0.0             h0cc432a_1
icu                       64.2                 he025d50_1    conda-forge
idna                      2.9                        py_1    conda-forge
imagecodecs-lite          2019.12.3        py38h9de7a3e_0    conda-forge
imageio                   2.8.0                      py_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        1.6.0            py38h32f6830_0    conda-forge
importlib_metadata        1.6.0                         0    conda-forge
intel-openmp              2020.0                      166
ipykernel                 5.3.0            py38h5ca1d4c_0    conda-forge
ipython                   7.15.0           py38h32f6830_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1                      py_0    conda-forge
jedi                      0.17.0           py38h32f6830_0    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jpeg                      9c                hfa6e2cd_1001    conda-forge
jsonschema                3.2.0            py38h32f6830_1    conda-forge
jupyter                   1.0.0                      py_2    conda-forge
jupyter_client            6.1.3                      py_0    conda-forge
jupyter_console           6.1.0                      py_1    conda-forge
jupyter_core              4.6.3            py38h32f6830_1    conda-forge
kiwisolver                1.2.0            py38heaebd3c_0    conda-forge
libblas                   3.8.0                    15_mkl    conda-forge
libcblas                  3.8.0                    15_mkl    conda-forge
libclang                  9.0.1           default_hf44288c_0    conda-forge
libiconv                  1.15              hfa6e2cd_1006    conda-forge
liblapack                 3.8.0                    15_mkl    conda-forge
libpng                    1.6.37               hfe6a214_1    conda-forge
libsodium                 1.0.17               h2fa13f4_0    conda-forge
libtiff                   4.1.0                h885aae3_6    conda-forge
libxml2                   2.9.10               h5d81f1c_1    conda-forge
libxslt                   1.1.33               h579f668_1    conda-forge
locket                    0.2.0                      py_2    conda-forge
lz4-c                     1.9.2                h62dcd97_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
mako                      1.1.3                    pypi_0    pypi
markupsafe                1.1.1            py38h9de7a3e_1    conda-forge
matplotlib                3.2.1                         0    conda-forge
matplotlib-base           3.2.1            py38h1626042_0    conda-forge
mistune                   0.8.4           py38h9de7a3e_1001    conda-forge
mkl                       2020.0                      166
monotonic                 1.5                        py_0    conda-forge
msgpack-python            1.0.0            py38heaebd3c_1    conda-forge
msys2-conda-epoch         20160418                      1
napari                    0.3.4                      py_1    conda-forge
napari-plugin-engine      0.1.5                      py_0    conda-forge
napari-svg                0.1.3                      py_0    conda-forge
nbconvert                 5.6.1            py38h32f6830_1    conda-forge
nbformat                  5.0.6                      py_0    conda-forge
networkx                  2.4                        py_1    conda-forge
notebook                  6.0.3            py38h32f6830_0    conda-forge
numcodecs                 0.6.4            py38h6538335_0    conda-forge
numpy                     1.18.4           py38h72c728b_0    conda-forge
numpydoc                  1.0.0              pyh9f0ad1d_0    conda-forge
olefile                   0.46                       py_0    conda-forge
openssl                   1.1.1g               he774522_0    conda-forge
packaging                 20.4               pyh9f0ad1d_0    conda-forge
pandas                    1.0.4            py38he6e81aa_0    conda-forge
pandoc                    2.9.2.1                       0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.7.0              pyh9f0ad1d_0    conda-forge
partd                     1.1.0                      py_0    conda-forge
pickleshare               0.7.5           py38h32f6830_1001    conda-forge
pillow                    7.1.2            py38h7011068_0    conda-forge
pip                       20.1.1                     py_1    conda-forge
pluggy                    0.13.1           py38h32f6830_1    conda-forge
prometheus_client         0.8.0              pyh9f0ad1d_0    conda-forge
prompt-toolkit            3.0.5                      py_0    conda-forge
prompt_toolkit            3.0.5                         0    conda-forge
psutil                    5.7.0            py38h9de7a3e_1    conda-forge
pycparser                 2.20                       py_0    conda-forge
pygments                  2.6.1                      py_0    conda-forge
pyopencl                  2020.1+cl12              pypi_0    pypi
pyopengl                  3.1.5                      py_0    conda-forge
pyopenssl                 19.1.0                     py_1    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py38h7ae7562_3    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtchart                 5.12                     pypi_0    pypi
pyqtwebengine             5.12.1                   pypi_0    pypi
pyrsistent                0.16.0           py38h9de7a3e_0    conda-forge
pyside2                   5.13.2           py38hfa7ce6d_2    conda-forge
pysocks                   1.7.1            py38h32f6830_1    conda-forge
python                    3.8.2           h5fd99cc_7_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pytools                   2020.2                   pypi_0    pypi
pytz                      2020.1             pyh9f0ad1d_0    conda-forge
pywavelets                1.1.1            py38h40bdaab_1    conda-forge
pywin32                   227              py38hfa6e2cd_0    conda-forge
pywinpty                  0.5.7                    py38_0    conda-forge
pyyaml                    5.3.1            py38h9de7a3e_0    conda-forge
pyzmq                     19.0.1           py38h77b9d75_0    conda-forge
qt                        5.12.5               h7ef1ec2_0    conda-forge
qtconsole                 4.7.4              pyh9f0ad1d_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
reikna                    0.7.5                    pypi_0    pypi
requests                  2.23.0             pyh8c360ce_2    conda-forge
scikit-image              0.17.2           py38he6e81aa_0    conda-forge
scikit-tensor-py3         0.4.1                    pypi_0    pypi
scipy                     1.4.1                    pypi_0    pypi
send2trash                1.5.0                      py_0    conda-forge
setuptools                47.1.1           py38h32f6830_0    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
sortedcontainers          2.1.0                      py_0    conda-forge
sphinx                    3.0.4                      py_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
sqlite                    3.30.1               hfa6e2cd_0    conda-forge
tblib                     1.6.0                      py_0    conda-forge
terminado                 0.8.3            py38h32f6830_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
tifffile                  2020.5.30                  py_0    conda-forge
tk                        8.6.10               hfa6e2cd_0    conda-forge
toolz                     0.10.0                     py_0    conda-forge
tornado                   6.0.4            py38hfa6e2cd_0    conda-forge
traitlets                 4.3.3            py38h32f6830_1    conda-forge
typing_extensions         3.7.4.2                    py_0    conda-forge
urllib3                   1.25.9                     py_0    conda-forge
vc                        14.1                 h869be7e_1    conda-forge
vispy                     0.6.4            py38h4b8e87e_1    conda-forge
vs2015_runtime            14.16.27012          h30e32a0_2    conda-forge
wcwidth                   0.1.9              pyh9f0ad1d_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.34.2                     py_1    conda-forge
widgetsnbextension        3.5.1                    py38_0    conda-forge
win_inet_pton             1.1.0                    py38_0    conda-forge
wincertstore              0.2                   py38_1003    conda-forge
winpty                    0.4.3                         4    conda-forge
wrapt                     1.12.1           py38h9de7a3e_1    conda-forge
xz                        5.2.5                h2fa13f4_0    conda-forge
yaml                      0.2.4                he774522_0    conda-forge
zarr                      2.4.0                      py_0    conda-forge
zeromq                    4.3.2                h6538335_2    conda-forge
zict                      2.0.0                      py_0    conda-forge
zipp                      3.1.0                      py_0    conda-forge
zlib                      1.2.11            h2fa13f4_1006    conda-forge
zstd                      1.4.4                h9f78265_3    conda-forge

Additional context

You are awesome and I assume my system is screwed up. However, every hint is appreciated!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

@haesleinhuepf if you could collect system info from the students with failures, together with the stack trace, and put them in a repo/gist somewhere, that would be super useful. Unfortunately with FOSS + OpenGL the number of variables is so high that itโ€™s really hard to track these things down. My number one thing is to try to get reliable failures from a brand new environment. Failures in long-lived environments with mixed pip, conda defaults, and conda-forge packages are to a first approximation impossible to debug, and even I just burn down the env and start again at that point.

Thank you for chiming in! We would absolutely love your help!

@haesleinhuepf

Alright, here you go: A UnicodeDecodeError (related to vispy as far as I can see) when importing napari in python

This is sometimes caused by terminals not being configured to handle unicode, as pointed out in this SO answer:

https://stackoverflow.com/a/12752945/224254

In your userโ€™s case, it sees they would need to do PYTHONIOENCODING=utf-8 jupyter notebook, although maybe itโ€™s a bit different in Windows terminals โ€” you possibly know a bit better than me there? =)

To stay organized, I could close this issue and open a new one when I hit another issue on windows?

Yep, I agree! Please keep raising them! =)

Possibly fixed by #1445 ? Which will be in the imminent 0.3.6 Release

Confirmed! @jni just pointed me to that the 0.3.6 release is out and it works! โค๏ธ

To stay organized, I could close this issue and open a new one when I hit another issue on windows?

Possibly fixed by #1445 ? Which will be in the imminent 0.3.6 Release

Alright, here you go: A UnicodeDecodeError (related to vispy as far as I can see) when importing napari in python: https://gist.github.com/haesleinhuepf/56d89fb999040f28415c03867c96cf83

Thanks to Ryan ๐Ÿ˜ƒ

Hey all,

just a little update on this issue and Windows compatibility: I ran a course on Napari with my students. Most of them run on Windows. Not sure how many of the 60 students really tried it, but 5 had issues with making Napari work on Windows. Various issues: Dll load failures, vispy issues, qt-error messages.

you could try uninstalling pyside2 and installing pyqt5 yesโ€ฆ but an important detail here is the combining of pip and conda environments, so results may vary depending on what you use to install/uninstall

Is there a recommended way of doing this? I didnโ€™t mange unfortunately ๐Ÿ˜” I also had weird experience with differences between older anaconda installations and more recent mini-condas. Not sure if this is relevant.

Iโ€™m just saying: Interest on my side for getting Napari work reliably on Windows is very high. Would love to support you if I can. Let me know if I can help!

Cheers, Robert

that might be useful, thanks ๐Ÿ˜ƒ

I struggle from time to time when switching between different machines and getting stuff like napari (but also pyopencl, gputools,โ€ฆ) to work. Thus, if you need someone who tests installation procedures on a couple of systems, let me know. Happy to help.

Are there plans for a standalone installer for napari?

#1289

maybe, you just want to update the installation instructions for napari

No, as the above instructions are for the workshop. We need instructions that will work in a generic environment (not just conda) with user-selected packages, not a small whitelist of stuff.

Iโ€™ll leave it open because we need the above to work! ๐Ÿ˜ฌ But Iโ€™m glad you have a working install now! ๐Ÿ˜Š