当前位置: 首页 > 知识库问答 >
问题:

python中枕头的安装问题

于捷
2023-03-14

我正在尝试用Python3.9在Windowsx64中安装pillow。Witout枕头,不幸的是,我不能安装matplotlib。

当我这样做时:

我得到这个错误:

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "C:\Users\Luca\AppData\Local\Temp\pip-install-h61p2lkf\pillow\setup.py",

第864行,在setup(文件“C:\Program Files\python39\lib\site-packages\setuptools_init_.py”中;第153行,在setup(**attrs)文件“C:\Program Files\python39\lib\distutils\core.py”中;第148行,在setup dist.run_commands()文件“C:\Program Files\python39\lib\distutils\dist.py”中;第966行,在run_commandself.run_command(cmd)文件“C:\Program Files\python39\lib\distutils\dist.py”中;第985行,在run_commandcmd_obj.run()文件“C::\users\luca\appdata\roaming\python\python39\site-packages\wheel\bdist_wheel.py”,第290行,在run_command self.distribtion.run_command(command)文件“c:\program files\python39\lib\distutils\cmd.py”中,第313行,在run_command self.distribtion.run_command(command)文件“c:\program files\python39\lib\distutils\dist.py”中,第985行,在run_command cmd_obj.run()文件“c:\program files\python39\lib\distutils\command\build.py”中:\program files\python39\lib\distutils\cmd.py“,第313行,在run_command self.distribution.run_c中ommand(命令)文件“C:\Program Files\python39\lib\distutils\dist.py”,第985行,在run_command cmd_obj.run()文件“C:\Program Files\python39\lib\distutils\command\build_ext.py”,第340行,在run self.build_extensions()文件“C:\users\luca\appdata\local\temp\pip-install-H61P2LKF\pillow\setup.py”,第694行,在build_extensions中引发RequiredDependencyException(f)main.RequiredDependencyException:zlib

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Luca\AppData\Local\Temp\pip-install-h61p2lkf\pillow\setup.py",

第918行,在Rise RequiredDependencyException(msg)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


  ----------------------------------------
  ERROR: Failed building wheel for pillow

我试图遵循我在这里找到的所有建议,但它继续生成错误。

请问谁能帮帮我?提前谢谢!

共有1个答案

党俊健
2023-03-14

Python 3.9于2020年10月5日发布。考虑到这是最近的事情,您可以预期许多库还没有得到支持。

但是,Pillow有一张Python3.9版本的票:https://github.com/python-pillow/Pillow/issues/4953,根据该版本的进展,您可以预期它很快就会得到支持。因此,您可以遵循这条规则,等到Pillow支持3.9,也可以暂时卸载Python3.9,然后安装Python3.8。

我的建议是使用Python3.8,因为它可以保护您免受其他库的类似问题。选择更新的Python版本的唯一原因是如果您真的需要一些新引入的特性。

 类似资料:
  • 我做了更多的阅读,并了解到Azure不能从环境中安装PIL或Pillow,因此需要安装在我的系统上,然后上传到Azure。我包含了一个名为“.skippythondeployment”的文件,这样它就不会擦除本地系统上设置的环境,但这样部署就会再次失败。 将代码推送到Azure时生成的日志的重要部分附在下面。 检测到的requirements.txt。您可以使用.skippythondeploym

  • 问题内容: 我用以下方法安装了软件包: 得到成功消息()。关闭并重新打开终端。 但是当我尝试: 我收到错误消息: ImportError:没有名为枕头的模块 如果再次运行,它说 问题答案: 尝试使用 要么 代替。是,不再保留的Python Imaging Library的分支。但是,为了保持向后兼容性,将使用旧的模块名称。

  • 问题内容: (Python 3.4,PIL 1.1.7,Pillow 2.5.1) 我希望这能复制原始GIF。 而是将第一帧保存为静止图像。 我究竟做错了什么? 问题答案: 使用此处的枕头Github上的脚本。

  • 我试图安装一个lambda函数,如本博客所示... https://www.obytes.com/blog/image-resizing-on-the-fly-with-aws-lambda-api-gateway-and-s3-storage 我按照这些步骤,上传了zip文件,并得到了一个错误。 当我尝试测试功能时: {“errorMessage”:“无法导入模块'resize_s3_image

  • 我试着安装枕头库,但我收到了这样的信息 命令“c:\users\timo\pycharmprojects\jumia\venv\scripts\python.exe-u-c”导入setuptools,tokenize;file='c:\users\timo\appdata\local\temp\pip-install-gr4big0c\pillow\setup.py';f=getattr(toke

  • 本文向大家介绍MySQL-Python安装问题小记,包括了MySQL-Python安装问题小记的使用技巧和注意事项,需要的朋友参考一下 安装完mysql-python后import加载模块提示以下错误, 于是google之,总结一下解决方法: (1)在mysql-ython的安装目录下找到site.cfg,将 注释符号去掉,并填上mysql_config的地址 (2)将mysql/lib下所有关于