Closed ihnorton closed 1 year ago
Hey! Sorry you are encountering this issue. Your dumped environment list doesn't include any details about what aicsimageio
and napari-aicsimageio
versions you have installed.
Can you run pip freeze
in your terminal and reply with the output?
On Python 3.10.10, with aicsimageio==4.10.0
, and napari-aicsimageio==0.7.2
installed I can load the image you provided with base aicsimageio
:
from aicsimageio import AICSImage
img = AICSImage("/home/eva/Downloads/JP2K-33003-2.tiff")
print(img.data.shape) # prints (1, 1, 1, 47076, 32671, 3) after 30 seconds of loading
And in napari I see:
Again it takes ~20 - 30 seconds to load.
Let me know!
Hi @evamaxfield, thanks for the response! Here's my version details -- looks like the same for aicsimagio and the plugin:
I did install base napari from conda-forge, so I'll try installing everything with pip (I'm on macos m1 and it looks like there's still quite a few packages that need to build from source 🤞 -- will report back).
Unfortunately it looks like the dependency chain isn't quite there yet on macOS-arm64 -- installing only via pip ends up with an error about missing Qt.
I tried again with a clean conda environment and got a slightly different error. Posting below FWIW. Thanks.
I also tried installing the arm64 napari release bundle, then the plugin via the plugin manager. In that case, importing from aicsimageio import AICSImage
fails, I get:
I am still a bit confused. The above output is the result of:
conda create --name test-aicsimageio python=3.10 -y
conda activate test-aicsimageio
pip install napari-aicsimageio napari[qt]
?
I guess I should say, napari-aicsimageio
doesn't install qt
.... maybe we should @psobolewskiPhD because of: https://github.com/AllenCellModeling/napari-aicsimageio/blob/main/napari_aicsimageio/core.py#L12
we have just sort of assumed the user would handle that but that seems like a bad assumption
Sorry I missed this issue! Couple things: first on arm64 macOS, pyside2 and pyqt5 are not available as wheels on pypi. So options are: install napari via conda (qt covered), install just qt backend via conda then napari via pip (without [all]), or rely on experimental support for qt6 via pip.
napari[qt]
and napari[all]
are both aliases for napari plus pyqt5, so on arm64 those will fail with pip, which remains the default plugin installer inside napari—this is rapidly changing!
Also, using either of those will break envs for people who have pyside2, or any of Qt6.
So the general idea is for plugins to not depend on either pyside2 or pyqt5 etc, but qtpy and napari.
Current napari-aicsimageio
behavior is correct in that regard. (One totally differnet issue is the java component for bioformats requires conda install (see https://github.com/AllenCellModeling/napari-aicsimageio/issues/46).)
I tried to test this issue on my M1, arm64 conda-forge, mamba solver.
I made a new 3.10 env with just napari (so both napari & Qt backend via conda).
Then pip install napari-aicsimageio
— this mimics using the plugin installer, which currently uses pip.
Note: I did not install JVM, etc. as needed for bioformats (bfio) using conda. As a result, I immediately got a hard crash related to java 😢
So I used napari --reset
to ensure nothing was carried over from settings—settings isolation is already fixed in main
but not released 😬
Then drag-n-drop the .svs worked (not sure why it shows as .tif in your example @evamaxfield ):
with lots of:
/Users/piotrsobolewski/Dev/miniforge3/envs/napari-test/lib/python3.10/site-packages/ome_types/_convenience.py:112: FutureWarning: The default XML parser will be changing from 'xmlschema' to 'lxml' in version 0.4.0. To silence this warning, please provide the `parser` argument, specifying either 'lxml' (to opt into the new behavior), or'xmlschema' (to retain the old behavior).!
Then I tried to properly install bioformats, as instructed in the README, using conda:
conda install -c conda-forge bioformats_jar
Except this results in the hard java related crash again 😬:
An irrecoverable stack overflow has occurred.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001edaa78a0, pid=7970, tid=259
#
# JRE version: OpenJDK Runtime Environment Zulu11.48+21-CA (11.0.11+9) (build 11.0.11+9-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu11.48+21-CA (11.0.11+9-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# C [libGLImage.dylib+0x68a0] void glgVectorCopy<GLGProfile_Generic32, (GLGMemory)0>(GLGOperationRec const*, unsigned long, GLDPixelModeRec const*)+0x55c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/piotrsobolewski/Dev/napari/hs_err_pid7970.log
#
# If you would like to submit a bug report, please visit:
# http://www.azulsystems.com/support/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
I am still a bit confused. The above output is the result of:
I used:
conda create -n np5
conda activate np5
mamba install bioformats_jar bfio napari pip
pip install napari-aicsimageio
napari
Thanks for the responses/explanations.
If that is the case, then yes, the error would occur because no pip install napari[qt]
was ran.
We have always assumed that users have installed napari with some backend (qt in our case) prior to installing napari-aicsimageio
. I will quickly push out a patch to fix that so you can just install pip install napari-aicsimageio
and it will install napari (with qt) for you
Sorry, was missing part of the line: napari pip
within mamba install bioformats_jar bfio napari pip
. In any case, napari does start successfully, which indicates that Qt is available.
I just pushed a new commit with qt as an added dep (via napari). And pushed a new git tag to trigger a new release. It should be out in ~15 minutes?
@evamaxfield But which Qt will you include? I think this will be majorly problematic, given that conda and pypi don't have the same names for pyqt packages, for example. Not to mention that pypi doesn't have wheels for arm64 macOS.
A functioning napari install has a Qt backend, which is why plugins shouldn't assert their own. See also: https://napari.org/stable/plugins/best_practices.html#don-t-include-pyside2-or-pyqt5-in-your-plugin-s-dependencies
Now if/given this was a case of installing the plugin without installing napari, then I'm not sure what we can do. it's a napari plugin after all. Make the README and napari-hub docs clearer that a functioning napari install needs to be present?
Hah. Well good thing the build broke: https://github.com/AllenCellModeling/napari-aicsimageio/actions/runs/4854973626/jobs/8652982285
I will revert the commit then.
I reverted the commit and hopefully fixed the tests (that I assume were broken due to aicsimageio recent development).
I don't know what to do about this current issue personally.
@ihnorton can you please try the barebones install that uses no mamba:
conda create --name test-aicsimageio python=3.10 -y
conda activate test-aicsimageio
pip install napari-aicsimageio napari[qt]
😬
I always end up going back to this zulip, where I was the one to add napari[all]
to this plugin and Talley and Czaki clarified:
Start--me being kinda stupid
https://napari.zulipchat.com/#narrow/stream/212875-general/topic/plugin.20install.20with.20optional.20dependencies/near/253882482
Talley with the explanation:
https://napari.zulipchat.com/#narrow/stream/212875-general/topic/plugin.20install.20with.20optional.20dependencies/near/253934983
Hah. Ya. I have just been out of this repo for a while so I have entirely forgotten. Good checks on docs and Zulip
can you please try the barebones install that uses no mamba:
That doesn't work for me on M1 because of reasons mentioned by @psobolewskiPhD above:
napari[qt] and napari[all] are both aliases for napari plus pyqt5, so on arm64 those will fail with pip, which remains the default plugin installer inside napari—this is rapidly changing!
Ahhh my bad. I don't have an M1 so I just don't encounter these issues. Do you think we need to do something on our side or is this an upstream issue?
Sorry I am just having a hard time understanding. I am out of practice in microscopy software land
@ihnorton Can you try:
mamba create -n napari-test python=3.10 napari bioformats_jar
conda activate napari-test
pip install napari-aicsimageio
(there appears to be a conflict that causes old napari-aicsimageio to be installed if just conda/mamba is used.
Edit: it's due to nd2 not being arm64 yet )
When I do this on my M1 then I can open your linked file after selecting napari-aicsimageio
from the pop-up. You may need to use napari --reset
to reset any file-type associations.
I don't think the pyramids are handled ideally, but it does open.
@psobolewskiPhD thanks, that worked.
Description
OpenSlide sample image from here: https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/JP2K-33003-2.svs
Does not load, long backtrace ending up with the following error:
Expected Behavior
Image is displayed, or give some information about missing X (if applicable?).
Reproduction
Download image, load with
File->Open File
(or viaOpen with Plugin
)Environment