我正在尝试使用python 3.9在Windows x64中安装枕头。不幸的是,Witout枕头无法安装matplotlib。
当我这样做时:
pip安装枕头
我收到此错误:
错误:命令错误,退出状态为1: 命令:'c:\ program files \ python39 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] = '“'”'C:\ Users \ Luca \ AppData \ Local \ Temp \ pip-install-h61p2lkf \ pillow \ setup.py'“”';; 文件 ='“'”'C:\ Users \ Luca \ AppData \ Local \ Temp \ pip-install-h61p2lkf \ pillow \ setup.py'“'”'; f = getattr(标记, '“'”'open'“'”',打开)(文件); code = f.read()。replace('“ '“'”'\\ n'“'”'); f.close(); exec(compile(code, file ,'“'”'exec'“'”')))' bdist_wheel -d'C:\ Users \ Luca \ AppData \ Local \ Temp \ pip-wheel-bymckwkk' CWD:C:\ Users \ Luca \ AppData \ Local \ Temp \ pip-install-h61p2lkf \ pillow
完整输出(172行): C:\ Users \ Luca \ AppData \ Local \ Temp \ pip-install-h61p2lkf \ pillow \ setup.py:42: 运行时警告:Pillow 7.2.0不支持Python 3.9,并且不支持 提供预构建的Windows二进制文件。我们不建议从 Windows上的源。 warnings.warn( 运行bdist_wheel 运行构建 运行build_py 创建版本 创建build \ lib.win-amd64-3.9 创建build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ BdfFontFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ BlpImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ BmpImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ BufrStubImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ContainerIO.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ CurImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ DcxImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ DdsImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ EpsImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ExifTags.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ features.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ FitsStubImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ FliImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ FontFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ FpxImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ FtexImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ GbrImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ GdImageFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ GifImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ GimpGradientFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ GimpPaletteFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ GribStubImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ Hdf5StubImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ IcnsImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ IcoImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ Image.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageChops.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageCms.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageColor.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageDraw.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageDraw2.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageEnhance.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageFilter.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageFont.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageGrab.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageMath.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageMode.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageMorph.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageOps.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImagePalette.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImagePath.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageQt.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageSequence.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageShow.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageStat.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageTk.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageTransform.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImageWin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ ImtImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ IptcImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ Jpeg2KImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ JpegImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ JpegPresets.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ McIdasImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ MicImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ MpegImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ MpoImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ MspImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PaletteFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PalmImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PcdImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PcfFontFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PcxImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PdfImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PdfParser.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PixarImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PngImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PpmImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PsdImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PSDraw.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ PyAccess.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ SgiImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ SpiderImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ SunImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ TarIO.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ TgaImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ TiffImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ TiffTags.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ WalImageFile.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ WebPImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ WmfImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ XbmImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ XpmImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL \ XVThumbImagePlugin.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL_binary.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL_tkinter_finder.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL_util.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL_version.py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL_ init _。py-> build \ lib.win-amd64-3.9 \ PIL 复制src \ PIL_ main _。py-> build \ lib.win-amd64-3.9 \ PIL 运行egg_info 编写src \ Pillow.egg-info \ PKG-INFO 将dependency_links写入src \ Pillow.egg-info \ dependency_links.txt 将顶级名称写入src \ Pillow.egg-info \ top_level.txt 读取清单文件“ src \ Pillow.egg-info \ SOURCES.txt” 阅读清单模板“ MANIFEST.in” 警告:找不到与“ .c”匹配的文件 警告:找不到与“ .h”匹配的文件 警告:找不到与“ .sh”匹配的文件 警告:找不到与“ .appveyor.yml”匹配的先前包含的文件 警告:找不到与“ .coveragerc”匹配的先前包含的文件 警告:找不到与“ .editorconfig”匹配的先前包含的文件 警告:找不到与“ .readthedocs.yml”匹配的先前包含的文件 警告:找不到与“ codecov.yml”匹配的先前包含的文件 警告:分发中的任何位置都找不到与“ .git ”匹配的先前包含的文件 警告:在分发中的任何位置都找不到与“ .pyc”匹配的先前包含的文件 警告:在分发中的任何位置都找不到与“ .so”匹配的先前包含的文件 找不到与“ .ci”匹配的先前包含的目录 编写清单文件“ src \ Pillow.egg-info \ SOURCES.txt” 运行build_ext 找不到zlib的标头或库文件, 从源编译枕头时需要的依赖项。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行,在 设定( 文件“ c:\ program files \ python39 \ lib \ site-packages \ setuptools_ init _。py”,第153行,位于 设定 返回distutils.core.setup(** attrs) 安装程序中的文件“ c:\ program files \ python39 \ lib \ distutils \ core.py”,第148行 dist.run_commands() 在run_commands中的文件“ c:\ program files \ python39 \ lib \ distutils \ dist.py”,行966 self.run_command(cmd) 在run_command中的文件“ c:\ program files \ python39 \ lib \ distutils \ dist.py”,行985 cmd_obj.run() 文件“ C:\ Users \ Luca \ AppData \ Roaming \ Python \ Python39 \ site-packages \ wheel \ bdist_wheel.py”, 290行,正在运行 self.run_command('build') 在run_command中的文件“ c:\ program files \ python39 \ lib \ distutils \ cmd.py”,第313行 self.distribution.run_command(命令) 在run_command中的文件“ c:\ program files \ python39 \ lib \ distutils \ dist.py”,行985 cmd_obj.run() 运行中的文件“ c:\ program files \ python39 \ lib \ distutils \ command \ build.py”,第135行 self.run_command(cmd_name) 在run_command中的文件“ c:\ program files \ python39 \ lib \ distutils \ cmd.py”,第313行 self.distribution.run_command(命令) 在run_command中的文件“ c:\ program files \ python39 \ lib \ distutils \ dist.py”,行985 cmd_obj.run() 运行中的文件“ c:\ program files \ python39 \ lib \ distutils \ command \ build_ext.py”,第340行 self.build_extensions() 文件“ C:\ Users \ Luca \ AppData \ Local \ Temp \ pip-install-h61p2lkf \ pillow \ setup.py”, 第694行,在build_extensions中 引发RequiredDependencyException(f) 主要。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行,在 引发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 ---------------------------------------- ERROR: Failed building wheel for pillow
我试图遵循在这里找到的所有建议,但是它继续产生错误。
请问谁能帮助我? 预先谢谢你!
答案 0 :(得分:2)
Python 3.9于2020年10月5日发布。鉴于这确实是最近的,您可以预料许多库将不被支持。
Pillow拥有一张适用于Python 3.9版本的票证:https://github.com/python-pillow/Pillow/issues/4953,根据那里的进度,您可以期望它很快得到支持。因此,您可以按照票证等待直到Pillow支持3.9,或者立即卸载Python 3.9并安装Python 3.8。
我的建议是使用python 3.8,因为它将保护您免受其他库的类似问题的困扰。选择新的Python版本的唯一原因是,如果您确实需要一些新引入的功能。