无法在Windows中安装枕头

问题描述 投票:10回答:6

安装过程要求使用zlib,我什至从Github进行安装和克隆。我是这一切的新手。

错误消息:

C:\Users\GThell\Pillow>pip install -e .
Obtaining file:///C:/Users/GThell/Pillow
Requirement already satisfied: olefile in c:\users\gthell\appdata\local\programs\python\python36\lib\site-packages (from Pillow==3.5.0.dev0)
Installing collected packages: Pillow
  Running setup.py develop for Pillow
    Complete output from command c:\users\gthell\appdata\local\programs\python\python36\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\GThell\\Pillow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
    Single threaded build for windows
    running develop
    running egg_info
    writing Pillow.egg-info\PKG-INFO
    writing dependency_links to Pillow.egg-info\dependency_links.txt
    writing requirements to Pillow.egg-info\requires.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 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 'tox.ini'
    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'
    running build_ext


    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:
       http://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "C:\Users\GThell\Pillow\setup.py", line 778, in <module>
        zip_safe=not debug_build(), )
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\develop.py", line 34, in run
        self.install_for_development()
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\develop.py", line 119, in install_for_development
        self.run_command('build_ext')
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\users\gthell\appdata\local\programs\python\python36\lib\distutils\command\build_ext.py", line 339, in run
        self.build_extensions()
      File "C:\Users\GThell\Pillow\setup.py", line 549, in build_extensions
        raise 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\GThell\Pillow\setup.py", line 790, in <module>
        raise 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:
       http://pillow.readthedocs.io/en/latest/installation.html
python github pip pillow
6个回答
2
投票

错误消息底部的URL说:

Windows安装我们提供适用于Windows的Pillow二进制文件,该文件针对在Wheel,Egg和可执行安装程序中的32位和64位版本的受支持的Python矩阵进行了编译。这些二进制文件包括所有可选库:

pip安装枕头

我会尝试这样做,以避免遇到诸如您遇到的依赖性问题。

编辑:枕头仅支持枕头> = 2.0.0 <3.5.0而不是3.6.0

编辑:希望这项工作,我无法在Windows上进行实际测试。


8
投票

用途:

easy_install pillow

点子不起作用


3
投票

我最近在Cygwin的Python3.6下安装了Pillow,并需要以下软件包:

  • gcc-core
  • libjpeg-devel
  • zlib-devel
  • python3-devel
  • python3-setuptools(运行easy-install-3.6)

我还使用以下方法安装了pip

easy-install-3.6 install pip

然后终于:

pip3 install pillow

成功。


1
投票

在Windows上,最好使用预编译的二进制文件(转轮),而不是从源代码构建。

Python 3.6.0 final将于本周晚些时候在2016-12-23上发布,并且Pillow尚不支持它。希望它将在2017年1月1日的下一个季度版本中受支持。

但是,与此同时,您可以从此处下载一个非官方的轮子,然后通过pip install filename.whl安装

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow


1
投票

您可以尝试使用Windows Installer软件包安装Pillow。选中https://pypi.org/project/Pillow/#files,Windows Installer软件包在页面底部。使用Python 3.7为我工作。


0
投票

在Windows中,由于框架问题,某些软件包无法使用。可以通过第三方网站下载和使用相同的软件包。

Unofficial python Binaries

选择相应版本下载相同。

然后是例如

pip install Downloads\\Pillow.whl

现在它将安装而没有错误

© www.soinside.com 2019 - 2024. All rights reserved.