fish-quant / big-fish

Toolbox for the analysis of smFISH images.
https://big-fish.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
55 stars 18 forks source link

ModuleNotFoundError on installation #82

Open binyaminZ opened 1 year ago

binyaminZ commented 1 year ago

Hi, Trying to install FISH-quant from this link: https://imjoy.io/#/app?w=fq-main&plugin=fish-quant/fq-imjoy:FISH-QUANT@stable&upgrade=1

I get the following error:

Logs ModuleNotFoundError Traceback (most recent call last)Cell In[3], line 18 16 from skimage.exposure import rescale_intensity 17 import bigfish # Is there a way to get the version without import? ---> 18 from bigfish import stack, plot, detection, segmentation, multistack 20 # TEMPORARY BUG FIX 21 # 1. fix_1: flipped orientation of images in kaibu: 22 # 'np.flipud': correct orientation of image in Kaibu. 23 # Flip y coordinates 24 25 # For MAC 26 if sys.platform == "darwin": File ~.conda\envs\fq-imjoy\lib\site-packages\bigfish\segmentation__init__.py:17 14 from .cell_segmentation import get_watershed_relief 15 from .cell_segmentation import apply_watershed ---> 17 from .nuc_segmentation import unet_3_classes_nuc 18 from .nuc_segmentation import apply_unet_3_classes 19 from .nuc_segmentation import from_3_classes_to_instances File ~.conda\envs\fq-imjoy\lib\site-packages\bigfish\segmentation\nuc_segmentation.py:16 13 from .postprocess import label_instances 14 from .postprocess import clean_segmentation ---> 16 from skimage.morphology.selem import disk 17 from skimage.morphology import reconstruction 20 # ### Unet model ### ModuleNotFoundError: No module named 'skimage.morphology.selem'

Versions:

Did I do anything wrong? Thanks!

StillJosh commented 1 year ago

Hey, I had the same error downloading it yesterday. What fixed it for me was downgrading skimage, as they apparently depreciated some parts of their morphology package.

If you are unfamiliar with the details of downgrading a package and just followed their guide (https://fq-imjoy.readthedocs.io/en/latest/imjoy-installation/), you probably set up a conda environment which you always activate via

conda activate fq-imjoy

After activation, you can just type in

pip install --upgrade scikit-image==0.19.2

and afterwards try the fishquant installation again.

Hope this fixes it for you as well!

muellerflorian commented 1 year ago

Sorry for the late reply, and THANKS a lot Josh for the workaround.

As Josh pointed out, the latest upgrade in skimage is causing this problem. Fixing the version to 0.19.2 helps to avoid this issue.

We will look into this and provide a solution asap.

Florian

muellerflorian commented 1 year ago

Error is caused by this line in big-fish: https://github.com/fish-quant/big-fish/blob/master/bigfish/segmentation/nuc_segmentation.py#L16

For skimage <= 0.19, we have this

from skimage.morphology.selem import disk

Seems that with version >= 0.20, this should be

from skimage.morphology import disk

Solution 1: fix skimage version <= 0.19 Solution 2: fix skimage version > 0.20, change import statement

@Henley13 , any thoughts on this?