2012年8月26日

PIL 的IOError: decoder jpeg not available錯誤 Mac, Ubuntu

IOError: decoder jpeg not available 環境Ubuntu 12.04, Mac 10.6.8


移除PIL

pip uninstall PIL rm -rf path/to/site-packages/PIL rm path/to/site-packages/PIL.pth
Ubuntu上重裝PIL
sudo apt-get install libjpeg libjpeg-dev sudo apt-get install libfreetype6 libfreetype6-dev
先裝jpeg source
wget http://www.ijg.org/files/jpegsrc.v8c.tar.gz tar -zxf jpegsrc.v8.tar.gz ./confugure && sudo make && sudo make install
pip install pil

在Mac上重裝PIL
移除PIL

pip uninstall PIL 先裝jpeg source
wget http://www.ijg.org/files/jpegsrc.v8.tar.gz tar -zxf jpegsrc.v8.tar.gz ./confugure && sudo make && sudo make install
或是用homebrew
brew install libjpeg
如果brew遇到 permission 問題,或是 brew cowardly refuse ...
使用下面的解法 ls -al /usr/local/bin/brew #see your original setting sudo chown root:wheel /usr/local/bin/brew #change it temp sudo brew install libjpeg #or sudo brew link jpeg if you already installed sudo chown : /usr/local/bin/brew 或是macports
sudo port selfupdate sudo port install py27-pil
之後重裝PIL
pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL
why not pip install PIL?
安裝成功會看到JPEG support OK


沒有留言:

張貼留言