pythonpython-3.xnumpytifflibtiff

numpy.distutils was deprecated. How to install libtiff?


I have a series of tiff images and need to read them using the following command:

from libtiff import TIFF
tif = TIFF.open(tiff_image, mode = "r")

I cannot use Image.open as I'd like to get object attribute in the next step (tif.iter_images).

Given this context, I do need to install libtiff but it fails due to dependency with numpy.distutils which has been deprecated. My Python version is 3.12.7.

Any suggestions?

Thank you!


Solution

  • numpy.distutils is removed in python 3.12. Here is the migration advice:

    https://numpy.org/doc/stable/reference/distutils_status_migration.html#distutils-status-migration


    To install libtiff you can use python 3.11 or 3.10

    libtiff's latest version was Released: Dec 21, 2017

    https://pypi.org/project/libtiff/#history


    Alternatively, you can use tifffile as @Mark commented

    tifffile is supported for python 3.10, 3.11, 3.12, 3.13.

    https://pypi.org/project/tifffile/