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

如何为Python 3.6安装PIL/Pillow?

袁运良
2023-03-14
pip install pil
Collecting pil
  Could not find a version that satisfies the requirement pil (from versions: )
No matching distribution found for pil

pip install Pillow
Collecting Pillow
  Using cached Pillow-3.3.1.zip
Installing collected packages: Pillow
  Running setup.py install for Pillow ... error
    Complete output from command c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ABDULR~1\\AppData\\Local\\Temp\\pip-build-rez5zpri\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ABDULR~1\AppData\Local\Temp\pip-a5bugnjo-record\install-record.txt --single-version-externally-managed --compile:
    Single threaded build for windows
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\PIL
    copying PIL\......................
    ..................................
    ..................................
    running egg_info
    writing Pillow.egg-info\PKG-INFO
    writing dependency_links to Pillow.egg-info\dependency_links.txt
    writing top-level names to Pillow.egg-info\top_level.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'Pillow.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs\_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    writing manifest file 'Pillow.egg-info\SOURCES.txt'
    copying PIL\OleFileIO-README.md -> build\lib.win-amd64-3.6\PIL
    running build_ext
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\setup.py", line 753, in <module>
        zip_safe=not debug_build(), )
      File "c:\python\python36\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\python\python36\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\python\python36\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\python\python36\lib\distutils\command\install.py", line 539, in run
        self.run_command('build')
      File "c:\python\python36\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\python\python36\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\python\python36\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\python\python36\lib\distutils\command\build_ext.py", line 338, in run
        self.build_extensions()
      File "C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\setup.py", line 521, in build_extensions
        ' using --disable-%s, aborting' % (f, f))
    ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting

    ----------------------------------------
Command "c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ABDULR~1\\AppData\\Local\\Temp\\pip-build-rez5zpri\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ABDULR~1\AppData\Local\Temp\pip-a5bugnjo-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\

不知道添加参数--disable-zlibPIP安装枕头--disable-zlib不正确。

在这里找不到与我的系统匹配的内容:https://pypi.python.org/pypi/pillow/3.0.0

64位Windows 10和Python 3.6

共有1个答案

颛孙玉石
2023-03-14

对于python版本2.x,您可以简单地使用

  • PIP安装枕头

但是对于python版本3.x,您需要指定

    null
 类似资料:
  • 我试图安装PIL(Python图像库)使用命令: 但我得到了以下信息: 您能帮我安装?

  • 我不能让皮尔在Pycharm上工作。安装Pillow/Pillow库后,它应该可以工作,但它没有。 我错过了什么?

  • 问题内容: 运行MAC 10.7.2在尝试安装PIL时,解决了许多gcc问题之后,安装退出并显示以下行: /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25:错误:stdarg.h:没有这样的文件或目录 我正在使用此行进行安装: 全部输出: 警告:”不是有效的软件包名称;请仅在.setup.py中使用分隔的包名称—使用/ System

  • 问题内容: 我已经尝试使用Google搜索和查找其他人的问题。但是,我仍然找不到在Mac OS X 10.7.2 Lion上安装PIL(适用于python 2.6或2.7)的清晰/简单配方。 问题答案: 如果您使用自制软件,则可以使用来安装PIL 。然后,您可能需要将安装目录()添加到PYTHONPATH中,或者将PIL目录本身的位置添加到任何site- packages目录中名为file的文件中

  • 我一直试图将xlrd安装到我的计算机中,但继续弹出以下错误msg。 “pip”不能识别为内部或外部命令、可操作程序或批处理文件。 我不确定我在这里做错了什么。 在我的电脑中,Python的版本是3.6 谢啦

  • 问题内容: 我需要在本地安装PIL,以在本地环境中测试GAE的图像api。 我抓住了Mac的PIL 1.1.6安装程序,当我去选择目的地(安装时)时,出现错误: 我在这台计算机上安装了Python2.5.x。 注意: 添加了赏金。我确实需要一种在Mac上本地测试图像API的方法。 问题答案: 这很容易: 安装MacPorts 安装 Python 2.5的 有 安装 弼为Python 2.5 与 在