installationpipmodulepython-imaging-library

Can't install mmaction: ERROR: Failed building wheel for Pillow


I'm trying to install mmaction module in python3.12.4 version (interpreter is venv) on Windows but no matter what command I try, at the end I always get:

RequiredDependencyException: zlib
     
      During handling of the above exception, another exception occurred:
     
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\babic\AppData\Local\Temp\pip-install-w9fq41js\pillow_fa46dd3e9ace49e494ddbe12da2bf332\setup.py", line 903, in <module>
          raise RequiredDependencyException(msg)
      RequiredDependencyException:
     
      The headers or library files could not be found for zlib,
      a required dependency when compiling Pillow from source.
     
      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html
     
     
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for Pillow
  Running setup.py clean for Pillow
Failed to build Pillow
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (Pillow)

I've tried:

pip install mmaction
pip install --upgrade pip
pip install --upgrade Pillow
python -m pip install --upgrade pip
python -m pip install --upgrade pillow
python -m pip install --upgrade pip setuptools wheel
pip install Pillow  # was installed successfully

What else can I do, to install this module?

Thank you.


Solution

  • mmaction: last release in 2020; work with Python 3.5, 3.6, 3.7 (see the bottom of the left column). Requires Pillow < 6.2.2 which only provides wheels up to Python 3.8. Seems rather old and abandoned. If you really need it — downgrade your Python.

    Try mmaction2, it works with 3.7, 3.8 and 3.9:

    pip install mmaction2
    

    If you cannot install it for 3.12 downgrade your Python.

    See migration guide and the docs.