简体   繁体   English

我正在尝试使用“pip install Pillow”安装枕头,但出现错误

[英]I am trying to install pillow using 'pip install Pillow' but I am getting error

Error:       
    `(env) E:\Python Projects\Flask\Flask Blog>pip install pillow
        Collecting pillow
          Using cached Pillow-7.2.0.tar.gz (39.1 MB)
        Building wheels for collected packages: pillow
          Building wheel for pillow (setup.py) ... error
          ERROR: Command errored out with exit status 1:
           command: 'e:\python projects\flask\env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Gaming\AppData\Local\Temp\pip-wheel-xk_48jkq'
               cwd: C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\
          Complete output (172 lines):
          C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\setup.py:42: RuntimeWarning: Pillow 7.2.0 does not support Python 3.9 and does not provide prebuilt Windows binaries. We do not recommend building from source on Windows.
            warnings.warn(
          running bdist_wheel
          running build
          running build_py
          creating build
          creating build\lib.win-amd64-3.9
          creating build\lib.win-amd64-3.9\PIL
          copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-3.9\PIL
          copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-3.9\PIL...
          ...


          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
          no previously-included directories found matching '.ci'
          writing manifest file 'src\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:
             https://pillow.readthedocs.io/en/latest/installation.html
        
          Traceback (most recent call last):
            File "C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\setup.py", line 864, in <module>
              setup(
            File "e:\python projects\flask\env\lib\site-packages\setuptools\__init__.py", line 153, in setup
              return distutils.core.setup(**attrs)
            File "C:\Users\Gaming\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup...
              ...
              ...

During handling of the above exception, another exception occurred:在处理上述异常的过程中,又发生了一个异常:

          Traceback (most recent call last):
            File "<string>", line 1, in <module>
            File "C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\setup.py", line 918, 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:
             https://pillow.readthedocs.io/en/latest/installation.html
        
        
          ----------------------------------------
          ERROR: Failed building wheel for pillow
          Running setup.py clean for pillow
        Failed to build pillow
        Installing collected packages: pillow
            Running setup.py install for pillow ... error
            ERROR: Command errored out with exit status 1:
             command: 'e:\python projects\flask\env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Gaming\AppData\Local\Temp\pip-record-8oe6sa1m\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\python projects\flask\env\include\site\python3.9\pillow'
                 cwd: C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\
            Complete output (174 lines):
            C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\setup.py:42: RuntimeWarning: Pillow 7.2.0 does not support Python 3.9 and does not provide prebuilt Windows binaries. We do not recommend building from source on Windows.
              warnings.warn(
            running install
            running build
            running build_py
            creating build
            creating build\lib.win-amd64-3.9
            creating build\lib.win-amd64-3.9\PIL
            copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-3.9\PIL
            copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-3.9\PIL
            copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-3.9\PIL
            copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-3.9\PIL
            copying src\PIL\ContainerIO.py -> build\lib.win-amd64-3.9\PIL
            copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-3.9\PIL...
            ...


            warning: no files found matching '*.h'
            warning: no files found matching '*.sh'
            warning: no previously-included files found matching '.appveyor.yml'
            warning: no previously-included files found matching '.coveragerc'
            warning: no previously-included files matching '*.so' found anywhere in distribution
            no previously-included directories found matching '.ci'
            writing manifest file 'src\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:
               https://pillow.readthedocs.io/en/latest/installation.html
        
            Traceback (most recent call last):
              File "C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\setup.py", line 864, in <module>
                setup(
              File "e:\python projects\flask\env\lib\site-packages\setuptools\__init__.py", line 153, in setup
                return distutils.core.setup(**attrs)...
               ...

        
            Traceback (most recent call last):
              File "<string>", line 1, in <module>
              File "C:\Users\Gaming\AppData\Local\Temp\pip-install-boxgam9w\pillow\setup.py", line 918, 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:
               https://pillow.readthedocs.io/en/latest/installation.html
        
        
            ----------------------------------------
        ERROR: Command errored out with exit status 1: 'e:\python projects\flask\env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Gaming\AppData\Local\Temp\pip-record-8oe6sa1m\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\python projects\flask\env\include\site\python3.9\pillow' Check the logs for full command output.`

I am begginer in Flask and i am getting this error while installation.我是 Flask 的初学者,安装时出现此错误。 My pip version is 20.2.3.我的 pip 版本是 20.2.3。 My python version is 3.9.我的python版本是3.9。 I also try to install Pillow using pip install PIL but it doesn't work anyway.我也尝试使用pip install PIL安装 Pillow,但它无论如何都不起作用。 I am using Windows 10. So can you please help me to install Pillow using pip.我使用的是 Windows 10。所以请你帮我使用 pip 安装 Pillow。

The answer is not very clear but is shown on the first line of the "complete output (172 lines)":答案不是很清楚,但显示在“完整输出(172行)”的第一行:

C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py:42: RuntimeWarning: Pillow 7.2.0 does not support Python 3.9 and does not provide prebuilt Windows binaries. C:\\Users\\Gaming\\AppData\\Local\\Temp\\pip-install-boxgam9w\\pillow\\setup.py:42: RuntimeWarning: Pillow 7.2.0 不支持 Python 3.9 并且不提供预构建的 Windows 二进制文件。 We do not recommend building from source on Windows.我们不建议在 Windows 上从源代码构建。

Pillow 8.0.0 is due out next week and will support Python 3.9. Pillow 8.0.0 将于下周发布,并将支持 Python 3.9。

See:看:

Edit: Pillow 8.0.0 supporting Python 3.9 is out now!编辑:支持 Python 3.9 的 Pillow 8.0.0 现已推出! https://pillow.readthedocs.io/en/stable/releasenotes/8.0.0.html https://pillow.readthedocs.io/en/stable/releasenotes/8.0.0.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试使用“pip”安装枕头 - I am trying to install pillow using 'pip' 为什么在尝试使用 pip 安装枕头时出现错误“[Errno 42] 非法字节序列”? - Why do I get an error "[Errno 42] Illegal byte sequence" when trying to install pillow using pip? 我正在尝试使用 pip install Scrapy 安装scrapy。 但我收到错误,因为需要 Microsoft Visual C++ 14.0 - I am trying to install scrapy using pip install Scrapy. but i am getting error as Microsoft Visual C++ 14.0 is required 我正在尝试在我的 python django web 上安装枕头模块 .. 但没有安装在 cpnael ZE206A54E977090CCE50CC8 服务器中 - I am trying to install pillow module on my python django web.. but is not installing in cpnael linux server 使用 PIP 在 Flatpak 中安装 Pillow - Using PIP to install Pillow in a Flatpak 我无法安装枕头文件,目前使用的是python 3.5.1,编码时也有错误,错误是NameError - I am unable to install pillow file and currently using python 3.5.1, also having an error while coding, the error is NameError 为什么在尝试使用 pip 安装健身房 openai 时出现错误? - Why am I getting an error while trying to install gym openai using pip? 如何安装“pip install rasa”,我收到错误消息 - how to install “pip install rasa”, I am getting error 我正在尝试使用pip安装MySQL库,但出现一个奇怪的错误 - I am attempting to install the MySQL library using pip but I am getting an odd error 我尝试使用 pip install django 安装 django 但我仍然收到此错误任何评论 - I tried to install django using pip install django but still i am getting this error any comments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM