pip, PIL and Pillow

3

我运行了以下命令将项目依赖项安装到虚拟环境 novacek 中:

(novacek) $ pip install -r reqs.txt

reqs.txt看起来像这样:

Django==1.4.4
Pillow==1.7.8
South==0.7.6
django-bootstrap-toolkit==2.8.0
django-debug-toolbar==0.9.4
django-filebrowser==3.5.1
-e git+https://github.com/ir4y/django-flatblocks.git@4f8b2c86fe94e19dc7aa86b80a204918e2142aff#egg=django_flatblocks-dev
django-generic-flatblocks==0.9.1
django-grappelli==2.4.3
django-hvad==0.2
django-photologue==2.5
docutils==0.10
psycopg2==2.4.6
wsgiref==0.1.2

正如您所看到的,没有PIL包,只有Pillow,但在安装过程的最后,我得到了以下结果:

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.3 (default, Feb 21 2013, 13:39:24)
              [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]
--------------------------------------------------------------------
*** TKINTER support not available
*** JPEG support not available
*** ZLIB (PNG/ZIP) support not available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------

这很奇怪。我之前已经获得了Pillow的设置摘要(顺便启用了对jpeg和zlib的支持,因为Pillow可以找到我的库)。

如果我在虚拟环境中安装后运行pip freeze命令,我会得到如下结果:

Django==1.4.4
PIL==1.1.7
Pillow==1.7.8
South==0.7.6
django-bootstrap-toolkit==2.8.0
django-debug-toolbar==0.9.4
django-filebrowser==3.5.1
-e git+https://github.com/ir4y/django-flatblocks.git@4f8b2c86fe94e19dc7aa86b80a204918e2142aff#egg=django_flatblocks-dev
django-generic-flatblocks==0.9.1
django-grappelli==2.4.3
django-hvad==0.2
django-photologue==2.5
docutils==0.10
psycopg2==2.4.6
wsgiref==0.1.2

PIL已经成为依赖项了。为什么?

1个回答

6

这完全正确。Pillow是PIL的一个分支,也是一种替代性的重新打包。

Pillow的PyPI页面

分支作者的目标是通过以下方式促进打包改进:

  • 公开开发并寻求社区支持。
  • 在分支中探索打包问题,最明显的是通过添加setuptools支持,同时还通过清理和重构打包代码。

在包内部,仍然是PIL项目,编译时仍会以该名称发送消息。

不幸的是,Pillow没有宣称满足PIL的要求,因此任何依赖于PIL的内容仍将拉取PIL。


我刚刚明白了。这是因为photologue包含PIL作为其依赖项。现在我正在尝试找出如何指定我不想安装PIL。 - clime
@clime: Pillow 满足 PIL 依赖。 - Martijn Pieters
但是,之后pip freeze不应该将PIL报告为依赖项。 - clime
2
@clime:从Pillow的作者那里得到了确认;我错了,Pillow不能满足PIL的依赖关系。 - Martijn Pieters
我已经尝试创建一个软件包来解决这个问题:https://github.com/mikeboers/PillowCase - Mike Boers
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接