Skip to content

Instantly share code, notes, and snippets.

@chengdh
Forked from dlo/patch.sh
Created November 3, 2013 14:08
Show Gist options
  • Save chengdh/7290588 to your computer and use it in GitHub Desktop.
Save chengdh/7290588 to your computer and use it in GitHub Desktop.
修正PIL的错误问题
#!/bin/sh
# Ref: http://ubuntuforums.org/showthread.php?t=1751455
# Uninstall PIL
# sudo pip uninstall PIL -q
# Install required libs
yes | apt-get install build-essential python-dev zlib1g-dev liblcms1-dev libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
# Link to correct location
if [ -d /usr/lib/x86_64-linux-gnu ]; then
# Ubuntu 11.04 64bit
ln -sf /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/local/lib/
ln -sf /usr/lib/x86_64-linux-gnu/libz.so /usr/local/lib/
ln -sf /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/local/lib/
elif [ -d /usr/lib/i386-linux-gnu ]; then
ln -sf /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/local/lib/
ln -sf /usr/lib/i386-linux-gnu/libz.so /usr/local/lib/
ln -sf /usr/lib/i386-linux-gnu/libjpeg.so.62 /usr/local/lib/
fi
# sudo pip install PIL
wget -q -O - https://raw.github.com/gist/1901496/patch.sh | sudo bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment