bauerdavid / napari-nD-annotator

BSD 3-Clause "New" or "Revised" License
29 stars 2 forks source link

nd_annotator_config.yaml not found #54

Closed TAspert closed 1 week ago

TAspert commented 1 week ago

Describe the bug

When I try to open nd-annotator, I get the error FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Administrateur/AppData/Local/napari/napari\nd_annotator_config.yaml'.

(This is probably the cause of several bugs later on. For example, when I try to interpolate, I get the error "'Layers' object has no attribute '_slice_indices'")

(napari-env) C:\WINDOWS\system32>napari -w napari-nD-annotator "Object List" "Annotation Toolbox"
Traceback (most recent call last):
  File "C:\Users\Administrateur\anaconda3\envs\napari-env\lib\site-packages\napari_nd_annotator\_widgets\_utils\persistence\persistent_widget_state.py", line 37, in __init__
    with open(self._config_path, "w") as new_file, open(default_settings_path, "r") as def_file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Administrateur/AppData/Local/napari/napari\\nd_annotator_config.yaml'
Traceback (most recent call last):
  File "C:\Users\Administrateur\anaconda3\envs\napari-env\lib\site-packages\napari_nd_annotator\_widgets\_utils\persistence\persistent_widget_state.py", line 37, in __init__
    with open(self._config_path, "w") as new_file, open(default_settings_path, "r") as def_file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Administrateur/AppData/Local/napari/napari\\nd_annotator_config.yaml'
C:\Users\Administrateur\anaconda3\envs\napari-env\lib\site-packages\napari_nd_annotator\_widgets\_utils\persistence\persistent_widget_state.py:77: UserWarning: id 'fill_objects_checkbox' not found in config file
  warnings.warn("id '%s' not found in config file" % widget_id)
Traceback (most recent call last):
  File "C:\Users\Administrateur\anaconda3\envs\napari-env\lib\site-packages\napari_nd_annotator\_widgets\_utils\persistence\persistent_widget_state.py", line 37, in __init__
    with open(self._config_path, "w") as new_file, open(default_settings_path, "r") as def_file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Administrateur/AppData/Local/napari/napari\\nd_annotator_config.yaml'

To Reproduce Simply launch the plugin after installation.

napari info napari: 0.5.4 Platform: Windows-10-10.0.19045-SP0 Python: 3.10.15 | packaged by conda-forge | (main, Sep 30 2024, 17:41:41) [MSC v.1941 64 bit (AMD64)] Qt: 5.15.2 PyQt5: 5.15.11 NumPy: 1.26.4 SciPy: 1.14.1 Dask: 2024.9.1 VisPy: 0.14.3 magicgui: 0.9.1 superqt: 0.6.7 in-n-out: 0.2.1 app-model: 0.3.0 psygnal: 0.11.1 npe2: 0.7.7 pydantic: 2.9.2

OpenGL:

Screens:

Optional:

Settings path:

-- I tried a clean Napari install in a new environment using conda:

conda create -y -n napari-env -c conda-forge python=3.10

but it did not solve the problem.

Of note, I had to downgrade NumPy to 1.26 for nd-annotator to launch.

Thank you!

TAspert commented 1 week ago

I'm sorry I did not go through all the other issues. Turns out that pulling the latest version from github solved the bug. python -m pip install git+https://github.com/bauerdavid/napari-nD-annotator

Thank you for this nice plugin!

bauerdavid commented 1 week ago

Thanks for using the plugin! 🙂