开发者

Ubuntu 11.04: Installing PIL into a virtualenv with PIP [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that i开发者_StackOverflow社区t can be reopened, visit the help center. Closed 11 years ago.

I have spent hours now trying to figure this out.

I do the following:

sudo apt-get install python-dev
sudo apt-get install libjpeg8-dev
sudo apt-get install libfreetype6 libfreetype6-dev
mkvirtualenv -p python2.7 --no-site-packages foobar
pip install PIL

Whenever I try to upload an image in my django-cms website I get an error message.


I've ran into the same issue while trying to use Django & Virtualenv - I couldn't upload images and after some research everything pointed towards PIL. I did try to reinstall the package but even with all the required libraries uploaded PIL still wouldn't support JPGs and PNGs.

Seems that Ubuntu peeps decided to moved the location of the libraries around (according to this fix: http://ubuntuforums.org/showpost.php?p=10804763&postcount=2).

My solution:

  1. Make sure you have all the libraries installed.

    sudo apt-get install libjpeg-dev libjpeg62 libjpeg62-dev zlib1g-dev libfreetype6 libfreetype6-dev

  2. Install Pillow, which is a saner package of PIL.

    pip install pillow (while in your virtualenv)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜