cgohlke / tifffile

Read and write TIFF files
https://pypi.org/project/tifffile
BSD 3-Clause "New" or "Revised" License
528 stars 155 forks source link

Issue when using tifffile 2020.10.1 inside KNIME scripting node with memmap #32

Closed sebi06 closed 3 years ago

sebi06 commented 4 years ago

Hi, I just tried to use tifffile 2020.10.1inside a KNIME scripting node (python 3.7.6) and got stuck (see below). When I try the same outside of KNIME it works ok, so I might also not a tifffile issue at all. But any hint or help is appreciated.

cannot import name 'memmap' from 'tifffile' (/home/sebi06/programs/knime/configuration/org.eclipse.osgi/578/0/.cp/py/tifffile.py)
Traceback (most recent call last):
File "<string>", line 10, in <module>
  File "/home/sebi06/miniconda3/envs/imageanalysis/lib/python3.7/site-packages/czitools-0.0.1-py3.7.egg/czitools/__init__.py", line 1, in <module>
    from .imgfileutils import get_imgtype, get_metadata, get_metadata_ometiff
  File "/home/sebi06/miniconda3/envs/imageanalysis/lib/python3.7/site-packages/czitools-0.0.1-py3.7.egg/czitools/imgfileutils.py", line 14, in <module>
    import czifile as zis
  File "/home/sebi06/miniconda3/envs/imageanalysis/lib/python3.7/site-packages/czifile/__init__.py", line 4, in <module>
    from .czifile import __doc__, __all__, __version__
  File "/home/sebi06/miniconda3/envs/imageanalysis/lib/python3.7/site-packages/czifile/czifile.py", line 208, in <module>
    from tifffile import (
ImportError: cannot import name 'memmap' from 'tifffile' (/home/sebi06/programs/knime/configuration/org.eclipse.osgi/578/0/.cp/py/tifffile.py)
cgohlke commented 4 years ago

Looks like you have an rogue/outdated/unrelated tifffile.py module at knime/configuration/org.eclipse.osgi/578/0/.cp/py/tifffile.py which shadows the tifffile 2020.10.1 package.

sebi06 commented 3 years ago

Oh, OK. So in that case I will file an issue for they KNIME guys and ask for help there.

cgohlke commented 3 years ago

Could be https://github.com/knime-ip/knip-python-extensions/blob/1.0.9/org.knime.knip.knimepython/py/tifffile.py?

sebi06 commented 3 years ago

Thx. Your are probably right. I filed and issue on the KNIME forum already.

https://forum.knime.com/t/issue-when-using-tifffile-2020-10-1-inside-knime-scripting-node-with-memmap/27814