[英]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.