擅长:python、mysql、java
<p>pypi(作者)上打包的PIL版本与setuptools不兼容,因此不易安装。人们已经在别处创建了易于安装的版本。目前,您需要指定一个查找链接URL并使用<a href="https://pypi.python.org/pypi/pip" rel="nofollow noreferrer">^{<cd1>}</a>获取一个好的包:</p>
<pre><code>pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL
</code></pre>
<p>通过将<code>pip install</code>与<code>--no-index</code>一起使用,可以避免发现PIL的PyPI(非固定)原始文件的风险。如果要使用<code>easy_install</code>,则必须使用指向已更正版本的源tarball的直接链接;easy_install仍然顽固地使用find links URL上的PyPI链接:</p>
<pre><code>easy_install http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz
</code></pre>
<p>要在构建中包含PIL,请指定具有相同版本pin的egg或使用versions部分:</p>
<pre><code>[buildout]
parts =
find-links =
http://dist.plone.org/thirdparty/
eggs =
PIL
versions = versions
[versions]
PIL = 1.1.7
</code></pre>
<p>编辑2011年3月:解决打包问题的修复程序现在已经合并到<a href="http://hg.effbot.org/pil-2009-raclette/overview" rel="nofollow noreferrer">PIL's development tree</a>中,因此这种解决方法可能很快就会过时。</p>
<p>2013年2月编辑:只需使用<a href="https://stackoverflow.com/a/7770547">Pillow</a>即可。:-)显然,等待原包装修好还没有收到效果。</p>