- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Django 和 ImageField 进行工作,问题是在迁移我的模型时出现一条消息:
news.news_Paragraph.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install Pillow"
因此,当我尝试使用 pip install Pillow
安装 Pillow 时,出现了问题:
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting Pillow
Using cached Pillow-3.2.0.zip
Installing collected packages: Pillow
Running setup.py install for Pillow
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-build-P1duQd/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-VHKYOb-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.11-intel-2.7
creating build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/__init__.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/_binary.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/_util.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/BdfFontFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/BmpImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ContainerIO.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/CurImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/DcxImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/DdsImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/EpsImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ExifTags.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/features.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/FliImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/FontFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/FpxImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/FtexImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/GbrImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/GdImageFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/GifImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/GimpGradientFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/GimpPaletteFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/GribStubImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/IcnsImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/IcoImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/Image.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageChops.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageCms.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageColor.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageDraw.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageDraw2.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageEnhance.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageFilter.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageFont.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageGrab.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageMath.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageMode.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageMorph.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageOps.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImagePalette.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImagePath.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageQt.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageSequence.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageShow.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageStat.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageTk.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageTransform.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImageWin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/ImtImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/IptcImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/JpegImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/JpegPresets.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/McIdasImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/MicImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/MpegImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/MpoImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/MspImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/OleFileIO.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PaletteFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PalmImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PcdImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PcfFontFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PcxImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PdfImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PixarImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PngImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PpmImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PsdImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PSDraw.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/PyAccess.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/SgiImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/SpiderImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/SunImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/TarIO.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/TgaImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/TiffImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/TiffTags.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/WalImageFile.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/WebPImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/WmfImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/XbmImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/XpmImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.11-intel-2.7/PIL
running egg_info
writing Pillow.egg-info/PKG-INFO
writing top-level names to Pillow.egg-info/top_level.txt
writing dependency_links to Pillow.egg-info/dependency_links.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.macosx-10.11-intel-2.7/PIL
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-build-P1duQd/Pillow/setup.py", line 767, in <module>
zip_safe=not debug_build(), )
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/install.py", line 53, in run
return _install.run(self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 573, in run
self.run_command('build')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 337, in run
self.build_extensions()
File "/private/var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-build-P1duQd/Pillow/setup.py", line 512, in build_extensions
' using --disable-%s, aborting' % (f, f))
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-build-P1duQd/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-VHKYOb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/81/hc0lc1y97v50nh7_m59rm39c0000gn/T/pip-build-P1duQd/Pillow
最佳答案
Pillow 正在使用 package-config 来定位其依赖库和包含路径。
可能的原因之一是您的 package-config 找不到正确的 zlib 路径。
检查你的 package-config 是否正常工作:
pkg-config zlib --libs
以下步骤对我有用:
brew install zlib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/zlib/1.2.11/lib/pkgconfig/
关于python - 如何在 Mac 上安装枕头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37011356/
Unifont 包含标记、变体选择器和其他不可打印字符的字形。 例如在 https://unifoundry.com/pub/unifont/unifont-14.0.04/font-builds/u
我想在图像中添加文本,例如“H”。然后,旋转文本。我尝试在 python 中使用 Pillow 6.0 模块来执行此操作。这是我的代码: import os from PIL import Image
我使用 Pillow (PIL) 6.0 并在图像中添加文字。我想把文字放在图片的中央。这是我的代码, import os import string from PIL import Image fr
我已经测试了计算并且数学是正确的(并考虑了字体的高度和宽度),但是在 Python 创建图像并将其放入 Photoshop 之后,文本的垂直和水平居中不是正确的。我应该用我的代码做些其他事情吗? fr
我想在 tkinter 的 Canvas 上使用图像,但我无法用 Pillow 打开图像。事实上,我的所有图像都与我的代码位于同一个文件夹中,但是当我放入“icon.png”时它不起作用。然后,当我输
我想在 tkinter 的 Canvas 上使用图像,但我无法用 Pillow 打开图像。事实上,我的所有图像都与我的代码位于同一个文件夹中,但是当我放入“icon.png”时它不起作用。然后,当我输
我有在图像上添加渐变的代码。 def st(path, gradient_magnitude=2.): im = Image.open(path) if im.mode != 'RGB
在我的 GAE 应用程序中,我尝试这样做: from PIL import Image 得到这个: Traceback (most recent call last): ... File "/
我有这个先决条件: CentOS 6.5 Python2.7 安装命令 ./configure --prefix=/usr/local --enable-unicode=ucs4;制作;进行安装; h
我正在尝试找到一种使用 Pillow 获取图像 channel 数的方法。这似乎相当微不足道,但我找不到它(简单的答案)。 我知道我可以用一个很小的开销来解决它,比如(2种可能性): 转换为 nump
我需要向图像添加透明渐变,如下图所示,我尝试过: def test(path): im = Image.open(path) if im.mode != 'RGBA':
我必须在图像上写一些文字。我用的是PIL,但是我无法在这张图片上设置特定的字体。我尝试使用下面的代码来做到这一点,但字体和字体大小似乎不受我的代码的影响。 PS:字体文件和python脚本在同一目录下
我有一个简单的脚本,它从图像 URL 列表中获取图像大小,但是当列表太大时它会太慢(例如:120 个 URL,运行可能需要 10 秒) def get_image_size(url): dat
我正在尝试使用 JPEG2000 从 pillow 保存图像,但得到了可怕的 OSError: encoder jpeg2k not available。 现在按照 pillow's docs 中的说
目标:最后的每一帧都应该有一个完整的 sudowoodo。任何不是 sudowoodo 的东西在 gif 中都应该是透明的(我也可以用白色)。我的最终目标是能够重新着色,所以我必须能够区分背景和口袋妖
我尝试使用的 Python 包仅适用于 3 channel 图像。如果我有一张灰度 PNG 图像,Pillow 的 Image.open() 自然会将其读取为单层图像。如何使用 Pillow 将 1
我正在使用 PIL 来旋转一些图像,我注意到输出文件要小得多,所以我尝试了一个测试:除了保存 exif 信息外,不对文件做任何事情(因为我知道 PIL 图像默认情况下不会保存exif 信息)。所以这是
我有一张图片,我正在使用 Django Forms 上传,它在变量中可用 InMemoryFile 我想要做的是让它渐进。 使图像渐进的代码 img = Image.open(source) img.
我正在尝试将 nxnx3 矩阵转换为 RGB 图像,其中矩阵中的每个空间都是 [R,G,B]。我以为这很容易,但我遇到了一个奇怪的错误。 我有这个图像:http://www.cs.brandeis.e
我正在尝试从 http 请求中获取 jpeg、gif 等,但出现错误。这是代码的一部分: def printimg(url): http = httppoolmgr() file =
我是一名优秀的程序员,十分优秀!