Hi, I'm running into persistent import errors when trying to use stardist in a Colab environment. Even after reinstalling dependencies carefully, I still encounter the following:
Error Tracebacks:
ImportError: numpy.core.multiarray failed to import
AttributeError: _ARRAY_API not found
ModuleNotFoundError: No module named 'stardist'
These occur especially when importing from:
from stardist.utils import fill_label_holes, random_label_cmap, calculate_extents, gputools_available
What I've Tried:
-
Uninstalled and reinstalled packages with pinned versions:
pip uninstall -y stardist csbdeep gputools
pip install numpy==1.23.5
pip install csbdeep==0.7.2
pip install --no-build-isolation --no-cache-dir stardist==0.8.3
-
Restarted the Colab runtime.
-
Attempted with and without TensorFlow (tensorflow==2.15).
-
Tried forcing reinstall of numpy with different versions (1.24.x, 1.23.5, 1.26.x, etc.)
Observation:
I suspect the issue is due to conflicting NumPy version requirements between stardist and other dependencies (e.g. csbdeep, scikit-image, etc.). Some packages internally install a newer version of numpy, causing stardist to break at import due to binary incompatibility (e.g., missing _ARRAY_API or failure in multiarray).
Environment:
- Platform: Google Colab
- Python: 3.11.8
- numpy: 1.23.5 (tried other versions too)
- csbdeep: 0.7.2
- stardist: 0.8.3
Request:
Is there a known compatible set of versions for stardist, csbdeep, and numpy for Python 3.11? Alternatively, should I downgrade to an older Python version (e.g. 3.9) to avoid these conflicts? Any guidance or environment YAML would be very helpful.
Thanks in advance for your support!
Hi, I'm running into persistent import errors when trying to use
stardistin a Colab environment. Even after reinstalling dependencies carefully, I still encounter the following:Error Tracebacks:
These occur especially when importing from:
What I've Tried:
Uninstalled and reinstalled packages with pinned versions:
Restarted the Colab runtime.
Attempted with and without TensorFlow (
tensorflow==2.15).Tried forcing reinstall of numpy with different versions (
1.24.x,1.23.5,1.26.x, etc.)Observation:
I suspect the issue is due to conflicting NumPy version requirements between
stardistand other dependencies (e.g.csbdeep,scikit-image, etc.). Some packages internally install a newer version ofnumpy, causingstardistto break at import due to binary incompatibility (e.g., missing_ARRAY_APIor failure inmultiarray).Environment:
Request:
Is there a known compatible set of versions for
stardist,csbdeep, andnumpyfor Python 3.11? Alternatively, should I downgrade to an older Python version (e.g. 3.9) to avoid these conflicts? Any guidance or environment YAML would be very helpful.Thanks in advance for your support!