napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
74 stars 27 forks source link

AttributeError when trying to save an animation #183

Closed rachcargill closed 7 months ago

rachcargill commented 10 months ago

I have been using napari-animation in the napari GUI with no problems however, I have recently encountered the following error:

Traceback (most recent call last): File "C:\Users\racha\miniconda3\envs\confocal\lib\site-packages\napari_animation_qt\animation_widget.py", line 161, in _save_callback if animation_kwargs.get("filename", None) is not None: AttributeError: 'str' object has no attribute 'get'

I have not changed anything about my code or the way I am using the plugin to create animations. I select keyframes and then set the steps I require. I used to be able to save the animation using the 'Save Animation' button in the GUI with ease, but now I receive the above error when I press the button.

Would you have any guesses as to why I am receiving this error? Thanks in advance.

alisterburt commented 10 months ago

Hi @rachcargill ! Sorry you ran into an issue, could you give me the output of 'pip list' so I can debug?

Can you also confirm that this is happening in a fresh environment?

rachcargill commented 10 months ago

Hi @alisterburt here is the output of pip list:


alabaster 0.7.13 app-model 0.2.1 appdirs 1.4.4 asciitree 0.3.3 asttokens 2.4.0 attrs 23.1.0 Babel 2.12.1 backcall 0.2.0 backports.functools-lru-cache 1.6.5 bokeh 3.2.2 Brotli 1.1.0 build 1.0.3 cachey 0.2.1 certifi 2023.7.22 charset-normalizer 3.2.0 click 8.1.7 cloudpickle 2.2.1 colorama 0.4.6 comm 0.1.4 contourpy 1.1.0 cytoolz 0.12.2 dask 2023.9.1 debugpy 1.8.0 decorator 5.1.1 distributed 2023.9.1 docstring-parser 0.15 docutils 0.16 entrypoints 0.4 exceptiongroup 1.1.3 executing 1.2.0 fasteners 0.17.3 freetype-py 2.2.0 fsspec 2023.9.0 HeapDict 1.0.1 hsluv 5.0.4 idna 3.4 imagecodecs 2023.9.4 imageio 2.31.1 imageio-ffmpeg 0.4.9 imagesize 1.4.1 importlib-metadata 6.8.0 importlib-resources 6.0.1 in-n-out 0.1.8 ipykernel 6.25.2 ipython 8.15.0 ipython-genutils 0.2.0 jedi 0.19.0 Jinja2 3.1.2 jsonschema 4.19.0 jsonschema-specifications 2023.7.1 jupyter_client 8.3.1 jupyter_core 5.3.1 kiwisolver 1.4.5 lazy_loader 0.3 locket 1.0.0 lz4 4.3.2 magicgui 0.7.3 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib-inline 0.1.6 mdurl 0.1.0 msgpack 1.0.5 mypy-extensions 1.0.0 napari 0.4.18 napari-animation 0.0.7 napari-console 0.0.8 napari-plugin-engine 0.2.0 napari-svg 0.1.10 nd2 0.7.1 nest-asyncio 1.5.6 networkx 3.1 npe2 0.7.2 numcodecs 0.11.0 numpy 1.25.2 numpydoc 1.5.0 packaging 23.1 pandas 2.1.0 parso 0.8.3 partd 1.4.0 pickleshare 0.7.5 Pillow 10.0.0 Pint 0.22 pip 23.2.1 pkgutil_resolve_name 1.3.10 platformdirs 3.10.0 pooch 1.7.0 prompt-toolkit 3.0.39 psutil 5.9.5 psygnal 0.9.3 pure-eval 0.2.2 pyarrow 13.0.0 pydantic 1.10.12 Pygments 2.16.1 PyOpenGL 3.1.6 pyproject_hooks 1.0.0 PyQt5 5.15.9 PyQt5-Qt5 5.15.2 PyQt5-sip 12.12.2 PySocks 1.7.1 python-dateutil 2.8.2 pytz 2023.3.post1 PyWavelets 1.4.1 pywin32 304 PyYAML 6.0.1 pyzmq 25.1.1 qtconsole 5.4.4 QtPy 2.4.0 referencing 0.30.2 requests 2.31.0 resource-backed-dask-array 0.1.0 rich 13.5.1 rpds-py 0.10.2 scikit-image 0.21.0 scipy 1.11.2 setuptools 68.2.2 shellingham 1.5.3 six 1.16.0 snowballstemmer 2.2.0 sortedcontainers 2.4.0 Sphinx 4.5.0 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 stack-data 0.6.2 superqt 0.5.4 tblib 1.7.0 tifffile 2023.8.30 tomli 2.0.1 tomli_w 1.0.0 toolz 0.12.0 tornado 6.3.3 tqdm 4.66.1 traitlets 5.9.0 typer 0.9.0 typing_extensions 4.7.1 tzdata 2023.3 urllib3 2.0.4 vispy 0.12.1 wcwidth 0.2.6 wheel 0.41.2 win-inet-pton 1.1.0 wrapt 1.15.0 xyzservices 2023.7.0 zarr 2.16.1 zict 3.0.0 zipp 3.16.2

I am pretty new to Python, so I am fully expecting there is something I am missing or overlooking with this. Yes, I am using a fresh environment, I created a new environment to see if the problem still occurs and it does.

For reference, the animation works when I set the coordinates and capture frames using script. However, I would also like the option to use the GUI to capture keyframes.

psobolewskiPhD commented 8 months ago

I can reproduce this error, sort of. If I click Save animation and enter a file name and save, everything is fine. But I hit cancel or exit the dialog, it gives the error.

@rachcargill are you getting the error even if you enter a file name into the dialog and click Save?

image