Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:25:25+00:00 2026-05-16T15:25:25+00:00

I am trying to get PIL working with Django 1.2.1 and Python 2.7 on

  • 0

I am trying to get PIL working with Django 1.2.1 and Python 2.7 on Snow Leopard

I have followed instructions I found here on SO and I should be doing it right.

The imports and selftest.py works fine and I both save and open images in the interactive python, but Django cannot use it.

I get the error

The _imaging C module is not installed

Why on earth does PIL seem to work everywhere but Django? I just doesn’t make any sense.

I have even tried reinstalling Django after installing libjpeg and PIL, but with no results, what am I doing wrong?

EDIT:
I have just discovered something weird. I can open and save images just fine, by using the interactive python in terminal. But for some reason, when I save an image, the colors are inverted!

The code used is:

im = Image.open("/Users/Me/Downloads/9.jpg")
im.save("/Users/Me/Downloads/8.jpg")

Does that give any clues as to why it does not work in Django at all?

EDIT 2:
Nevermind that last part, it seems that the jpg I chose, was with CMYK colors, and that cannot be saved directly as an RGB or something along those lines.

EDIT 3:
And then again, maybe it is correct that Django is looking in the wrong place.

Exception Location: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/Image.py in __getattr__, line 36
Python Executable:  /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.0

This is what Django puts out. I just looked at the version, silly me. The top line clearly states that it is looking in the 2.5 path. Wonder why its 2.5 since SL should be born with 2.6, oh well, no matter.

Can anyone then tell me how to direct Django to use the newer ones? The solution with changing manage.pydid nothing. Why is that, that should have told Django to use 2.7 no matter what.. right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:25:26+00:00Added an answer on May 16, 2026 at 3:25 pm

    Make sure that your Django code is referencing the same version of Python that you’re using “everywhere” else. Snow Leopard comes with Python 2.6.1 by default found at /usr/bin/python.

    If you’ve installed Python 2.7 by some other means, it’s probably found at another path with a symlink at /usr/bin/python2.7 pointing to its actual location. If PIL is installed under Python 2.7, then you cannot be referencing /usr/bin/python in your code because that is pointing you to the wrong version of Python.

    The best practice would be to explicitly specify that you want to use Python 2.7 in the shebang (#!/usr/bin/env python2.7) for your Django initialization script (e.g. manage.py).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to install PIL for Python 2.6 on Mac OS X Snow Leopard
im trying to get multi texturing working and have so far got miltiple textures
I'm trying to install PIL on snow-leopard , but I am running into a
I'm new to Django (and Python) and I have been trying to work out
So i am trying get 2 div-containers which both should contain centered text (Both
I have created a virtualenv with the --no-site-packages option. I get an error trying
I've been having trouble trying to get PIL to nicely downsample images. The goal,
I am trying to debug OpenERP 6.1 on Windows 7 x64. I have Python
I am trying to get django-registration up and running on my newbie setup on
i am trying to do something with the PIL Image library in django, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.