Installing PIL to use with Django on Mac OS X

后端 未结 9 920
梦如初夏
梦如初夏 2020-12-13 21:40

I\'m really annoyed by installation of PIL (Python Imaging Library) on Mac OS X 10.6. Does anyone have it installed and could post the recipe here? I\'ve tried a lot of them

相关标签:
9条回答
  • 2020-12-13 21:50

    There is a packaging fork of PIL that attempts to make it easier to install and support on many modern platforms, including OS X:

    • http://pypi.python.org/pypi/Pillow/1.6

    You should be able to install it on OS X with pip or easy_install (assuming you have XCode). If you have any trouble, please open a ticket here:

    • https://github.com/collective/Pillow/issues
    0 讨论(0)
  • 2020-12-13 21:51

    Hey check out this article, worked wonders for me on Snow Leopard.

    I'd also recommend using libjpeg 0.6 instead of 0.7 noted in the article.

    Good luck.

    0 讨论(0)
  • 2020-12-13 21:52

    Yes, I have issues with PIL on 10.6.6 too, homebrew and easy_install.

    The easiest solution for me was to easy_install PIL / pip install PIL, navigate to /Library/Python/2.6/site-packages/, and symlink the PIL-1.1.7-.....egg file to PIL

    ln -s PIL-................egg PIL
    
    
    >>> import PIL
    >>> from PIL import Image
    # no more problems.
    

    Edit: These days, I try to use Pillow, a library built to help install PIL. Try pip install pillow - can't hurt!

    0 讨论(0)
  • 2020-12-13 21:54

    I have issues installing PIL with brew and easy_install on my Mac too. My solution is to download source code from http://www.pythonware.com/products/pil/, extract the tar ball and use

    python setup.py install
    

    to compile and install the package.

    0 讨论(0)
  • 2020-12-13 22:02

    Following steps worked for me:

    $ brew install pip
    $ export ARCHFLAGS="-arch i386 -arch x86_64"
    $ pip install pil
    
    0 讨论(0)
  • 2020-12-13 22:02

    After fresh OS installation tried these steps:

    1. Installed homebrew
    2. brew install libjpeg
    3. brew install pil
    4. easy_install pil
    5. cd /Library/Python/2.6/site-packages
    6. ln -s /usr/local/Cellar/pil/1.1.7/lib/python2.6/site-packages/PIL PIL

    After that I was able to load and save jpeg files... I know that this issue has a lot of different solutions and I'm not 100% my way will work for other, but it's worth to try if you just bumping your head in to the wall :)

    0 讨论(0)
提交回复
热议问题