Ricki
Ricki

Reputation: 11

Installing Pillow on Windows with 32-bit Python

I'm getting this error while running pip install pillow.

During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "c:\python39-32\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "c:\python39-32\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:\python39-32\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "C:\Users\AfrouzA\AppData\Local\Temp\pip-install-ldehb4hc\pillow_fab211561b6345c2962286f7fb8be3f4\_custom_build\backend.py", line 53, in build_wheel
      return super().build_wheel(wheel_directory, config_settings, metadata_directory)
    File "C:\Users\AfrouzA\AppData\Local\Temp\pip-build-env-mn8zg9s3\overlay\Lib\site-packages\setuptools\build_meta.py", line 434, in build_wheel
      return self._build_with_temp_dir(
    File "C:\Users\AfrouzA\AppData\Local\Temp\pip-build-env-mn8zg9s3\overlay\Lib\site-packages\setuptools\build_meta.py", line 419, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\AfrouzA\AppData\Local\Temp\pip-install-ldehb4hc\pillow_fab211561b6345c2962286f7fb8be3f4\_custom_build\backend.py", line 47, in run_setup
      return super().run_setup(setup_script)
    File "C:\Users\AfrouzA\AppData\Local\Temp\pip-build-env-mn8zg9s3\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 1005, in <module>
  __main__.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
Failed to build pillow
ERROR: Could not build wheels for pillow, which is required to install pyproject.toml-based projects
WARNING: There was an error checking the latest version of pip.

I upgraded pip. Now I'm running pip 23.3 from C:\Python39-32\lib\site-packages\pip (python 3.9).

Upvotes: 1

Views: 567

Answers (1)

Hugo
Hugo

Reputation: 29314

It looks like you have a 32-bit version of Python installed. From Pillow 10, precompiled 32-bit wheels are no longer provided:

https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#bit-wheels

pip is therefore trying to build from source, and you don't have the necessary dependencies.

Options:

Upvotes: 0

Related Questions