constantinpape / cluster_tools

Distributed segmentation for bio-image-analysis
MIT License
34 stars 14 forks source link

threadpool issue #44

Open martinschorb opened 6 months ago

martinschorb commented 6 months ago

Hi,

I am trying to set up mboie_utils on Windows and Python 3.9 (fresh mamba installation, no other packages). I run into:

...\cluster_tools\watershed\watershed.py", line 140, in <module>
    @threadpool_limits.wrap(limits=1)  # restrict the numpy threadpool to 1 to avoid oversubscription
AttributeError: type object 'threadpool_limits' has no attribute 'wrap'

I remember having hit this before but could not find an issue for it.

martinschorb commented 6 months ago

running a pip install -U threadpoolctl after the mobie_utils installation does the Job. Maybe the environment can be adapted accordingly.

constantinpape commented 6 months ago

Thanks! I guess threadpoolctl is missing from some dependency list.

martinschorb commented 6 months ago

I really had a lot of dependency trouble installing the mobie conda env using a miniforge base environment under Windows, When using the full-blown Anaconda and installing mamba in there and then creating the mobie env, there were no issues.

constantinpape commented 6 months ago

The issue with threadpoolctl should be fixed here: https://github.com/conda-forge/python-elf-feedstock/pull/12

constantinpape commented 6 months ago

For other dependency issues feel free to create a new issue.

martinschorb commented 5 months ago

Just running into that again...

Throws that error.

martinschorb commented 5 months ago

import cluster_tools is sufficient to throw the error. import elf works.

versions shipped by conda-forge:

python-elf-0.5.0 cluster_tools-0.4.6 mobie_utils-0.4.5

Python is the conda default 3.11.5 Could that be causing problems?

martinschorb commented 5 months ago

same issue with Python 3.10.13 in Miniforge

martinschorb commented 5 months ago

works now in a fresh Anaconda with new environment Python 3.11.9 I am starting to hate this conda mess...

constantinpape commented 5 months ago

This seems to depend on the version of threadpoolctl. I will set a lower version limit with the new release here.

constantinpape commented 5 months ago

This should be fixed for environments that include mobie_utils with the new release. See https://github.com/conda-forge/mobie_utils-feedstock/pull/18/files.