How to install libtiff in Codespace

125 Views Asked by At

I am a pretty newby when it comes to python and because I can not install proper VS Code on my work notebook I am using Codespace in the browser to work on some programs to help with data evaluation.

Yesterday I asked about the size of TIF images when I use PIL to combine them. I learned about compression and that I need libtiff library for it.

I tried the classic way of installing it with pip install libtiff So far this has worked for a lot of packages. But this time it raises an error and I don't understand a thing. I found some people talking about having problems isntalling libtiff but this was after installing it: Python cannot find LibTIFF library, even though LibTIFF is already installed

Also I never installed a package manualy and I am not so familiar with comand lines. And I am only in the codespace/github online enviroment which makes things looking even more complicated.

The full output of the installation process was quite long so i shortened it down to what I hope are important parts. I have installed numpy before.

Defaulting to user installation because normal site-packages is not writeable
Collecting libtiff
  Using cached libtiff-0.4.2.tar.gz (129 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: libtiff
  Building wheel for libtiff (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [454 lines of output]
      /tmp/pip-install-el105ybn/libtiff_3c8f7be65cac4954b582e0fcd10ed845/setup.py:77: DeprecationWarning:
      
        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html
      
      
        from numpy.distutils.core import setup, Extension
      Warning: Assuming default configuration (libtiff/bitarray-a1646c0/bitarray/{setup_bitarray,setup}.py was not found)
      Appending libtiff.bitarray configuration to libtiff
      Ignoring attempt to set 'name' (from 'libtiff' to 'libtiff.bitarray')
      Appending libtiff configuration to
      Ignoring attempt to set 'name' (from '' to 'libtiff')
      0.4.2
      running bdist_wheel
      running build
      running config_cc
      INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      INFO: build_src
      INFO: building extension "bittools" sources
      INFO: building extension "tif_lzw" sources
      INFO: building extension "libtiff.bitarray._bitarray" sources
      INFO: building extension "libtiff.bittools" sources
      INFO: building extension "libtiff.tif_lzw" sources
      INFO: building data_files sources
      INFO: build_src: building npy-pkg config files
      /usr/local/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      !!
      
              ********************************************************************************
              Please avoid running ``setup.py`` directly.
              Instead, use pypa/build, pypa/installer or other
              standards-based tools.
      
              See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
              ********************************************************************************

      <................ A LOT OF MORE STUFF CAME HERE ..........>

      INFO: CCompilerOpt.cache_flush[863] : write cache to path -> /tmp/pip-install-el105ybn/libtiff_3c8f7be65cac4954b582e0fcd10ed845/build/temp.linux-x86_64-cpython-311/cc
ompiler_opt_cache_ext.py                                                                                                                                                          [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for libtiff
  Running setup.py clean for libtiff
Failed to build libtiff
ERROR: Could not build wheels for libtiff, which is required to install pyproject.toml-based projects

0

There are 0 best solutions below