Closed xwyan1230 closed 7 months ago
it's quite hard to debug just from that. Can you let us know:
Thank you for the prompt response. I'm not sure what are the necessary information needed, but here're the answers:
napari installing conda create -y -n my_env -c conda-forge python=3.9 conda activate my_env python -m pip install “napari[all]”
napari-animation installing pip install napari-animation
when see the error msg I try to run from napari_animation import Animation
Thank you so much! Let me know if you need additional information!
Thanks! Can you also share the full error message?
Also, does running napari --info
work? 🤞 😬
Yes! full error msg here (I masked some personal information in the path)
Traceback (most recent call last):
File "/Users/.../03_20230706_img-check_3d-seg.py", line 6, in
napari --info napari: 0.4.16 Platform: macOS-10.16-x86_64-i386-64bit System: MacOS 13.3.1 Python: 3.9.0 | packaged by conda-forge | (default, Oct 14 2020, 22:56:29) [Clang 10.0.1 ] Qt: 5.15.2 PyQt5: 5.15.6 NumPy: 1.23.3 SciPy: 1.9.1 Dask: 2022.05.2 VisPy: 0.10.0
OpenGL:
Screens:
Plugins:
hi @xwyan1230 - this looks like an error relating to your napari install itself rather than something specific to napari-animation. Could you confirm that you can open a napari viewer (either programmatically from Python or by typing napari
at the shell prompt?)
@alisterburt Yes! I confirm that napari works perfectly fine! If you think this is the issue, is there any recommended way to install napari and napari-animation? I’d happy to set up a new environment to give it a try!
Bit late to the party, so hopefully this isn't an actual issue anymore, but I can reproduce this with napari 0.4.16 and animation 0.0.7
caused by https://github.com/napari/napari-animation/pull/167
On 0.4.16 _version.py
uses version
and not __version__
With napari 0.4.17 and onwards it's __version__
So I think to prevent this in the case of someone using an older napari for whatever reason, either we need to have napari>=0.4.17 in setup or alter the version checking logic to the more canonical:
from importlib.metadata import version
...
napari_version = version('napari')
This works as expected for all versions of napari I tested.
Wasn't there an issue with importlib_metadata and older Python versions, though? That word combination is triggering for me for some reason. 😂 But anyway, that seems easy enough and seems at least as good as hardcoding __version__
going forward, so let's go with it!
According to https://docs.python.org/3/library/importlib.metadata.html#module-importlib.metadata importlib.metadata
is from python 3.8. I think napari dropped 3.7 in 0.4.15.
importlib_metadata
is a backport, but I think it would need to be installed.
Honestly, the watermarking is pretty optional and not important to functionality, so could try/except and return a value like old
or something?
I'm at the very early step of trying set this up but came across this error msg. Wonder if anybody might have any quick thought!
ImportError: cannot import name 'version' from 'napari._version' (/....../python3.9/site-packages/napari/_version.py)
Thanks!