使用 32 位 Python 在 Windows 上安装 Pillow

问题描述 投票:0回答:2

我在运行 pip installpillow 时收到此错误。

在处理上述异常的过程中,又发生了一个异常:

  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]

注意:此错误源自子进程,并且可能不是 pip 的问题。
错误:枕头搭建轮失败
制作枕头失败
错误:无法为枕头构建轮子,这是安装基于 pyproject.toml 的项目所必需的
警告:检查 pip 的最新版本时出错。

我升级了pip。现在我正在从 C:\Python39-32\lib\site-packages\pip (python 3.9) 运行 pip 23.3。

pip python-imaging-library 32-bit
2个回答
0
投票

您似乎安装了 32 位版本的 Python。从 Pillow 10 开始,不再提供预编译的 32 位轮子:

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

pip 因此尝试从源代码构建,并且您没有必要的依赖项。

选项:


-1
投票

配合良好
Python: 3.11.4
Pip 23.2.1
pillow: 9.5.0
© www.soinside.com 2019 - 2024. All rights reserved.