NHPatterson / wsireg

multimodal whole slide image registration in a graph structure
MIT License
76 stars 7 forks source link

Error after installing #44

Closed alcrevenna closed 2 years ago

alcrevenna commented 2 years ago

Description

I installed wsireg, then open anaconda navigator, saw a new environment, called anaconda3 where wsireg was installed. Launched a jupyter notebook from that environment.

Got this error: ImportError: cannot import name 'url_to_fs' from 'fsspec.core' (/opt/anaconda3/lib/python3.7/site-packages/fsspec/core.py)

What I Did

from wsireg.wsireg2d import WsiReg2D

got this error:

ImportError: cannot import name 'url_to_fs' from 'fsspec.core' (/opt/anaconda3/lib/python3.7/site-packages/fsspec/core.py)

Full trace call:
ImportError                               Traceback (most recent call last)
<ipython-input-1-d0c345d58298> in <module>
----> 1 from wsireg.wsireg2d import WsiReg2D

/opt/anaconda3/lib/python3.7/site-packages/wsireg/__init__.py in <module>
      1 # flake8: noqa
----> 2 from .wsireg2d import WsiReg2D
      3 
      4 """wsireg."""
      5 

/opt/anaconda3/lib/python3.7/site-packages/wsireg/wsireg2d.py in <module>
     12 from wsireg.parameter_maps.preprocessing import ImagePreproParams
     13 from wsireg.parameter_maps.reg_model import RegModel
---> 14 from wsireg.reg_images import RegImage, MergeRegImage
     15 from wsireg.reg_images.loader import reg_image_loader
     16 from wsireg.reg_shapes import RegShapes

/opt/anaconda3/lib/python3.7/site-packages/wsireg/reg_images/__init__.py in <module>
      4 from .ometiff_reg_image import OmeTiffRegImage  # noqa: F401
      5 from .sitk_reg_image import SitkRegImage  # noqa: F401
----> 6 from .aics_reg_image import AICSRegImage  # noqa: F401
      7 from .np_reg_image import NumpyRegImage  # noqa: F401
      8 from .merge_reg_image import MergeRegImage  # noqa: F401

/opt/anaconda3/lib/python3.7/site-packages/wsireg/reg_images/aics_reg_image.py in <module>
      4 import numpy as np
      5 import SimpleITK as sitk
----> 6 from aicsimageio import AICSImage
      7 
      8 from wsireg.reg_images import RegImage

/opt/anaconda3/lib/python3.7/site-packages/aicsimageio/__init__.py in <module>
      4 """Top-level package for AICSImageIO."""
      5 
----> 6 from .aics_image import AICSImage  # noqa: F401
      7 from .aics_image import imread  # noqa: F401
      8 from .aics_image import imread_dask  # noqa: F401

/opt/anaconda3/lib/python3.7/site-packages/aicsimageio/aics_image.py in <module>
     15 from .formats import FORMAT_IMPLEMENTATIONS, READER_TO_INSTALL
     16 from .metadata import utils as metadata_utils
---> 17 from .readers import TiffGlobReader
     18 from .readers.reader import Reader
     19 from .types import PhysicalPixelSizes

/opt/anaconda3/lib/python3.7/site-packages/aicsimageio/readers/__init__.py in __getattr__(name)
     40 
     41         path, clsname = _LOOKUP[name].rsplit(".", 1)
---> 42         mod = import_module(path, __name__)
     43         return getattr(mod, clsname)
     44     raise AttributeError(f"module {__name__!r} has no attribute import name {name!r}")

/opt/anaconda3/lib/python3.7/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

/opt/anaconda3/lib/python3.7/site-packages/aicsimageio/readers/tiff_glob_reader.py in <module>
     25 )
     26 from ..metadata import utils as metadata_utils
---> 27 from ..utils import io_utils
     28 from .reader import Reader
     29 

/opt/anaconda3/lib/python3.7/site-packages/aicsimageio/utils/io_utils.py in <module>
      5 from typing import Tuple
      6 
----> 7 from fsspec.core import url_to_fs
      8 from fsspec.spec import AbstractFileSystem
      9 

ImportError: cannot import name 'url_to_fs' from 'fsspec.core' (/opt/anaconda3/lib/python3.7/site-packages/fsspec/core.py)
NHPatterson commented 2 years ago

Hi @alcrevenna, thanks for bringing the issue to my attention. Looks like an issue with aicsimageio and one of its dependencies. Let me try and see if I can reproduce. This may be an issue with conflicting dependencies in your own environment as it sounds like it installed in the base anaconda3 environment.

One thing you can try is to open a terminal and create a new environment just for wsireg like this:

in terminal

conda create -n wreg python=3.9
conda activate wreg
pip install wsireg
pip install notebook

launch jupyter notebook from terminal from this environment

conda activate wreg
jupyter notebook
# should have a link to the http of the notebook
NHPatterson commented 2 years ago

I can confirm that this is an issue in dependencies in your local environment. Thanks for your patience. The GUI should have it's first release in the next couple of weeks which should simplify all of this.

Here is how I tested:

from terminal

conda create -n wreg-test python=3.7 # create environment
pip install wsireg # install wsireg
python # open python in terminal 

in python in terminal

from wsireg import WsiReg2D
# no error
NHPatterson commented 2 years ago

@alcrevenna Did any of these suggestions help you? Thanks

alcrevenna commented 2 years ago

Hi @NHPatterson, I tried the first one and that worked on installing the program. I then tried to run it on a regular large tif and then it got stuck on reg_graph.register_images() forever, so I had to interrupt the kernel. I will now try to use it on vsi or pyramidal tifs. thanks, Alvaro