2013-10-30 60 views
1

爲了讓我得到在Heroku PIL JPEG的支持,我不得不使用PIL的分叉/編輯的版本在這裏發現汞+ https://bitbucket.org/etienned/pil-2009-raclette/#egg=PIL在Heroku Python的PIL支持JPEG的作品,但沒有在本地

它告訴我JPEG support available對Heroku的,但在我本地的Ubuntu 12.04我得到*** JPEG support not available

我是否在我的ubuntu機器上缺少一些特定的軟件包?下面是使用PIP和requirements.txt

的Heroku安裝轉儲:

-----> 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)[email protected]:~/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

嘗試做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,如this post中所述。

+0

嘿謝謝,我以前見過這篇文章,但我不認爲我有正確的軟件包列表。我只是繼續'無法找到包libjpeg'。 已驗證我在Ubuntu 12.04上,而且我只是做了一個'apt-get update'。 編輯:我能夠安裝除libjpeg以外的所有其他軟件包。儘管libjpeg-dev工作得很好。 – Robeezy

+0

好吧,它工作。 libjpeg不需要,所以我只安裝了libjpeg-dev和其他軟件包,做了符號鏈接,它都很好。 – Robeezy

相關問題