Closed GenevieveBuckley closed 2 years ago
Yeah, looks like the event "payload" has changed since that code was written. So we should figure out what the event value actually looks like and try to get the same info out of it.
(thanks for the detailed error message @GenevieveBuckley!)
source_image = source_image_event.value
AttributeError: 'Image' object has no attribute 'value'
I poked around with the debugger, and found that source_image_event
is a napari Image layer object.
It looks like instead of receiving an event where the event value is the object we want to grab, instead we are getting the event value returned directly. That sounds familiar, I think there was some change relatively recently that did this.
I am consistently seeing this attribute error when I use zarpaint:
AttributeError: 'Image' object has no attribute 'value'
.It doesn't seem to crash the program, but I think we should still try to get rid of it (if nothing else, it's been confusing the issue for me when I run into other errors that do cause zarpaint to crash, and makes it harder to debug)
Full error message (click to expand)
```python-traceback In [1]: import numpy as np In [2]: import napari In [3]: data = np.ones((500,500,500)) In [4]: viewer = napari.view_image(data) Traceback (most recent call last): File "C:\Users\CryoEM\.conda\envs\zarpaint-dev\lib\site-packages\magicgui\widgets\_bases\value_widget.py", line 57, in _on_value_change self.changed.emit(value) File "psygnal\\_signal.py", line 682, in psygnal._signal.SignalInstance.emit File "psygnal\\_signal.py", line 724, in psygnal._signal.SignalInstance._run_emit_loop File "psygnal\\_signal.py", line 725, in psygnal._signal.SignalInstance._run_emit_loop File "psygnal\\_signal.py", line 745, in psygnal._signal.SignalInstance._run_emit_loop File "C:\Users\CryoEM\.conda\envs\zarpaint-dev\lib\site-packages\toolz\functoolz.py", line 306, in __call__ return self._partial(*args, **kwargs) File "c:\users\cryoem\documents\github\zarpaint\src\zarpaint\_zarpaint.py", line 20, in _set_default_labels_path source_image = source_image_event.value AttributeError: 'Image' object has no attribute 'value' If you suspect this is an IPython 8.3.0 bug, please report it at: https://github.com/ipython/ipython/issues or send an email to the mailing list at ipython-dev@python.org You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it. Extra-detailed tracebacks for bug-reporting purposes can be enabled via: %config Application.verbose_crash=True ```Operating system: Windows 10 Python version: python 3.9.12
conda list (click to expand)
(Note: I'm using a dev version of zarpaint in this conda env, but I've seen the same error message happen in other situations too) ``` (zarpaint-dev) C:\Users\CryoEM\Documents\GitHub\zarpaint>conda list # packages in environment at C:\Users\CryoEM\.conda\envs\zarpaint-dev: # # Name Version Build Channel alabaster 0.7.12 py_0 conda-forge aom 3.3.0 h0e60522_1 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge asciitree 0.3.3 py_2 conda-forge asttokens 2.0.5 pyhd8ed1ab_0 conda-forge attrs 21.4.0 pyhd8ed1ab_0 conda-forge babel 2.10.1 pyhd8ed1ab_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge blosc 1.21.1 h74325e0_2 conda-forge bokeh 2.4.2 py39hcbf5309_1 conda-forge brotli 1.0.9 h8ffe710_7 conda-forge brotli-bin 1.0.9 h8ffe710_7 conda-forge brotlipy 0.7.0 py39hb82d6ee_1004 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-blosc2 2.1.1 h09319c2_0 conda-forge ca-certificates 2021.10.8 h5b45459_0 conda-forge cachey 0.2.1 pyh9f0ad1d_0 conda-forge certifi 2021.10.8 py39hcbf5309_2 conda-forge cffi 1.15.0 py39h0878f49_0 conda-forge cfitsio 4.1.0 h5a969a9_0 conda-forge charls 2.3.4 h39d44d4_0 conda-forge charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge click 8.1.3 py39hcbf5309_0 conda-forge cloudpickle 2.0.0 pyhd8ed1ab_0 conda-forge colorama 0.4.4 pyh9f0ad1d_0 conda-forge cryptography 36.0.2 py39h7bc7c5c_1 conda-forge cycler 0.11.0 pyhd8ed1ab_0 conda-forge cytoolz 0.11.2 py39hb82d6ee_2 conda-forge dask 2022.5.0 pyhd8ed1ab_0 conda-forge dask-core 2022.5.0 pyhd8ed1ab_0 conda-forge debugpy 1.6.0 py39h415ef7b_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge distributed 2022.5.0 pyhd8ed1ab_0 conda-forge docstring_parser 0.13 pyhd8ed1ab_0 conda-forge docutils 0.15.2 py39hcbf5309_3 conda-forge entrypoints 0.4 pyhd8ed1ab_0 conda-forge executing 0.8.3 pyhd8ed1ab_0 conda-forge fasteners 0.17.3 pyhd8ed1ab_0 conda-forge fonttools 4.33.3 py39hb82d6ee_0 conda-forge freetype 2.10.4 h546665d_1 conda-forge freetype-py 2.3.0 pyhd8ed1ab_0 conda-forge fsspec 2022.3.0 pyhd8ed1ab_0 conda-forge giflib 5.2.1 h8d14728_2 conda-forge heapdict 1.0.1 py_0 conda-forge hsluv 5.0.2 pyh44b312d_0 conda-forge icu 69.1 h0e60522_0 conda-forge idna 3.3 pyhd8ed1ab_0 conda-forge imagecodecs 2022.2.22 py39hc1e9cd8_4 conda-forge imageio 2.19.1 pyhcf75d05_0 conda-forge imagesize 1.3.0 pyhd8ed1ab_0 conda-forge importlib-metadata 4.11.3 py39hcbf5309_1 conda-forge importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge intel-openmp 2022.0.0 h57928b3_3663 conda-forge intervaltree 3.0.2 py_0 conda-forge ipykernel 6.13.0 py39h832f523_0 conda-forge ipython 8.3.0 py39hcbf5309_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge jbig 2.1 h8d14728_2003 conda-forge jedi 0.18.1 py39hcbf5309_1 conda-forge jinja2 3.0.3 pyhd8ed1ab_0 conda-forge jpeg 9e h8ffe710_1 conda-forge jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge jupyter_core 4.9.2 py39hcbf5309_0 conda-forge jxrlib 1.1 h8ffe710_2 conda-forge kiwisolver 1.4.2 py39h2e07f2f_1 conda-forge krb5 1.19.3 h1176d77_0 conda-forge lcms2 2.12 h2a16943_0 conda-forge lerc 3.0 h0e60522_0 conda-forge libaec 1.0.6 h39d44d4_0 conda-forge libavif 0.10.1 h8ffe710_0 conda-forge libblas 3.9.0 14_win64_mkl conda-forge libbrotlicommon 1.0.9 h8ffe710_7 conda-forge libbrotlidec 1.0.9 h8ffe710_7 conda-forge libbrotlienc 1.0.9 h8ffe710_7 conda-forge libcblas 3.9.0 14_win64_mkl conda-forge libclang 13.0.1 default_h81446c8_0 conda-forge libcurl 7.83.0 h789b8ee_0 conda-forge libdeflate 1.10 h8ffe710_0 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge liblapack 3.9.0 14_win64_mkl conda-forge libpng 1.6.37 h1d00b33_2 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libssh2 1.10.0 h680486a_2 conda-forge libtiff 4.3.0 hc4061b1_3 conda-forge libwebp 1.2.2 h57928b3_0 conda-forge libwebp-base 1.2.2 h8ffe710_1 conda-forge libxcb 1.13 hcd874cb_1004 conda-forge libzlib 1.2.11 h8ffe710_1014 conda-forge libzopfli 1.0.3 h0e60522_0 conda-forge locket 1.0.0 pyhd8ed1ab_0 conda-forge lz4 4.0.0 py39h0878066_1 conda-forge lz4-c 1.9.3 h8ffe710_1 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge magicgui 0.4.0 pyhd8ed1ab_0 conda-forge markupsafe 2.1.1 py39hb82d6ee_1 conda-forge matplotlib-base 3.5.2 py39h581301d_0 conda-forge matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge mkl 2022.0.0 h0e2418a_796 conda-forge msgpack-python 1.0.3 py39h2e07f2f_1 conda-forge msys2-conda-epoch 20160418 1 conda-forge munkres 1.1.4 pyh9f0ad1d_0 conda-forge napari 0.4.14 pyhd8ed1ab_0 conda-forge napari-console 0.0.4 pyhd8ed1ab_1 conda-forge napari-plugin-engine 0.2.0 pyhd8ed1ab_2 conda-forge napari-svg 0.1.5 pyhd8ed1ab_0 conda-forge nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge networkx 2.8 pyhd8ed1ab_0 conda-forge npe2 0.3.0 pyhd8ed1ab_0 conda-forge numcodecs 0.9.1 py39h415ef7b_2 conda-forge numpy 1.22.3 py39h0948cea_2 conda-forge numpydoc 1.3.1 pyhd8ed1ab_0 conda-forge openjpeg 2.4.0 hb211442_1 conda-forge openssl 1.1.1o h8ffe710_0 conda-forge packaging 21.3 pyhd8ed1ab_0 conda-forge pandas 1.4.2 py39h2e25243_1 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge partd 1.2.0 pyhd8ed1ab_0 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 9.1.0 py39ha53f419_2 conda-forge pint 0.19.2 pyhd8ed1ab_0 conda-forge pip 22.0.4 pyhd8ed1ab_0 conda-forge pooch 1.6.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.29 pyha770c72_0 conda-forge psutil 5.9.0 py39hb82d6ee_1 conda-forge psygnal 0.3.4 py39h2e07f2f_0 conda-forge pthread-stubs 0.4 hcd874cb_1001 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pydantic 1.9.0 py39hb82d6ee_1 conda-forge pygments 2.12.0 pyhd8ed1ab_0 conda-forge pyopengl 3.1.6 pyh6c4a22f_0 conda-forge pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge pyqt 5.12.3 py39hcbf5309_8 conda-forge pyqt-impl 5.12.3 py39h415ef7b_8 conda-forge pyqt5-sip 4.19.18 py39h415ef7b_8 conda-forge pyqtchart 5.12 py39h415ef7b_8 conda-forge pyqtwebengine 5.12.1 py39h415ef7b_8 conda-forge pyrsistent 0.18.1 py39hb82d6ee_1 conda-forge pysocks 1.7.1 py39hcbf5309_5 conda-forge python 3.9.12 h9a09f29_1_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.9 2_cp39 conda-forge pytomlpp 1.0.11 py39h1f6ef14_0 conda-forge pytz 2022.1 pyhd8ed1ab_0 conda-forge pywavelets 1.3.0 py39h5d4886f_1 conda-forge pywin32 303 py39hb82d6ee_0 conda-forge pyyaml 6.0 py39hb82d6ee_4 conda-forge pyzmq 22.3.0 py39he46f08e_2 conda-forge qt 5.12.9 h556501e_6 conda-forge qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge qtpy 2.1.0 pyhd8ed1ab_0 conda-forge requests 2.27.1 pyhd8ed1ab_0 conda-forge scikit-image 0.19.2 py39h2e25243_0 conda-forge scipy 1.8.0 py39hc0c34ad_1 conda-forge setuptools 62.2.0 py39hcbf5309_0 conda-forge shellingham 1.4.0 pyh44b312d_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.9 h82413e6_0 conda-forge snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge sphinx 4.5.0 pyh6c4a22f_0 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_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.5 pyhd8ed1ab_2 conda-forge sqlite 3.38.5 h8ffe710_0 conda-forge stack_data 0.2.0 pyhd8ed1ab_0 conda-forge superqt 0.3.2 pyhd8ed1ab_0 conda-forge tbb 2021.5.0 h2d74725_1 conda-forge tblib 1.7.0 pyhd8ed1ab_0 conda-forge tensorstore 0.1.20 pypi_0 pypi tifffile 2022.5.4 pyhd8ed1ab_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge toolz 0.11.2 pyhd8ed1ab_0 conda-forge tornado 6.1 py39hb82d6ee_3 conda-forge tqdm 4.64.0 pyhd8ed1ab_0 conda-forge traitlets 5.2.0 pyhd8ed1ab_0 conda-forge typer 0.4.1 pyhd8ed1ab_0 conda-forge typing-extensions 4.2.0 hd8ed1ab_1 conda-forge typing_extensions 4.2.0 pyha770c72_1 conda-forge tzdata 2022a h191b570_0 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge unicodedata2 14.0.0 py39hb82d6ee_1 conda-forge urllib3 1.26.9 pyhd8ed1ab_0 conda-forge vc 14.2 hb210afc_6 conda-forge vispy 0.10.0 py39h5d4886f_0 conda-forge vs2015_runtime 14.29.30037 h902a5da_6 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge wheel 0.37.1 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 py39hcbf5309_4 conda-forge wrapt 1.14.1 py39hb82d6ee_0 conda-forge xorg-libxau 1.0.9 hcd874cb_0 conda-forge xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge xz 5.2.5 h62dcd97_1 conda-forge yaml 0.2.5 h8ffe710_2 conda-forge zarpaint 0.1.1.dev17+gc582d5b dev_0