1

为了让我在 Heroku 上获得 PIL JPEG 支持,我必须使用在这里找到的 PIL 的分叉/编辑版本 hg+ https://bitbucket.org/etienned/pil-2009-raclette/#egg=PIL

它告诉我JPEG support availableHeroku 但在我本地的 Ubuntu 12.04 上我得到*** JPEG support not available.

我只是在我的 ubuntu 机器上缺少一些特定的包吗?这是使用 pip 和 requirements.txt 安装的转储

赫罗库

-----> Installing dependencies using Pip (1.3.1)

 ...

       Obtaining PIL from hg+https://bitbucket.org/etienned/pil-2009-raclette/#egg=PIL (from -r requirements.txt (line 48))
         Updating ./.heroku/src/pil clone
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
         Running setup.py egg_info for package PIL

       Installing collected packages: PIL
         Running setup.py develop for PIL

           --------------------------------------------------------------------
           PIL 1.2a0 SETUP SUMMARY
           --------------------------------------------------------------------
           version       1.2a0
           platform      Python 2.7.4 (default, Apr  6 2013, 22:14:13)
                         [GCC 4.4.3] on linux2
           --------------------------------------------------------------------
           *** TKINTER support not available
           --- JPEG support available
           *** WEBP support not available
           --- ZLIB (PNG/ZIP) support available
           --- FREETYPE2 support available
           --- LITTLECMS support available
           --------------------------------------------------------------------
           To add a missing option, make sure you have the required
           library, and set the corresponding ROOT variable in the
           setup.py script.

           To check the build, run the selftest.py script.
           Creating /app/.heroku/python/lib/python2.7/site-packages/PIL.egg-link (link to .)
           PIL 1.2a0 is already the active version in easy-install.pth
           Installing pilfile.py script to /app/.heroku/python/bin
           Installing pilfont.py script to /app/.heroku/python/bin
           Installing pilconvert.py script to /app/.heroku/python/bin
           Installing pilprint.py script to /app/.heroku/python/bin
           Installing pildriver.py script to /app/.heroku/python/bin

           Installed /app/.heroku/src/pil
       Successfully installed PIL

本地(Ubuntu)

(venv)robbie@ubuntu:~/git/myproject$ pip install -r requirements.txt 

...

Obtaining PIL from hg+https://bitbucket.org/etienned/pil-2009-raclette/#egg=PIL (from -r requirements.txt (line 48))
  Updating ./venv/src/pil clone
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
  Running setup.py egg_info for package PIL

Requirement already satisfied (use --upgrade to upgrade): static in ./venv/lib/python2.7/site-packages (from dj-static==0.0.5->-r requirements.txt (line 12))
Requirement already satisfied (use --upgrade to upgrade): tablib in ./venv/lib/python2.7/site-packages (from django-import-export==0.1.4->-r requirements.txt (line 20))
Requirement already satisfied (use --upgrade to upgrade): diff-match-patch in ./venv/lib/python2.7/site-packages (from django-import-export==0.1.4->-r requirements.txt (line 20))
Installing collected packages: PIL
  Running setup.py develop for PIL

    --------------------------------------------------------------------
    PIL 1.2a0 SETUP SUMMARY
    --------------------------------------------------------------------
    version       1.2a0
    platform      Python 2.7.3 (default, Apr 10 2013, 06:20:15)
                  [GCC 4.6.3] on linux2
    --------------------------------------------------------------------
    *** TKINTER support not available
    *** JPEG support not available
    *** WEBP support not available
    *** ZLIB (PNG/ZIP) support not available
    *** FREETYPE2 support not available
    *** LITTLECMS support not available
    --------------------------------------------------------------------
    To add a missing option, make sure you have the required
    library, and set the corresponding ROOT variable in the
    setup.py script.

    To check the build, run the selftest.py script.
    Creating /home/robbie/git/myproject/venv/lib/python2.7/site-packages/PIL.egg-link (link to .)
    Adding PIL 1.2a0 to easy-install.pth file
    Installing pildriver.py script to /home/robbie/git/myproject/venv/bin
    Installing pilprint.py script to /home/robbie/git/myproject/venv/bin
    Installing pilfile.py script to /home/robbie/git/myproject/venv/bin
    Installing pilconvert.py script to /home/robbie/git/myproject/venv/bin
    Installing pilfont.py script to /home/robbie/git/myproject/venv/bin

    Installed /home/robbie/git/myproject/venv/src/pil
Successfully installed PIL
4

1 回答 1

4

尝试这样做sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev,然后像这样对库进行符号链接:

ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib
ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib

并重新运行pip install,如本文所述。

于 2013-10-30T23:31:09.287 回答