2012-09-05 29 views
1

我正在嘗試使用簡單的captcha與我的django一起工作。讓django-simple-captcha正常工作

以下四個步驟後:

我跑python manage.py test captcha.

它給了我這樣的:

Traceback (most recent call last): 
    File "/Users/cnnlakshmen_2000/Projects/Permissions/captcha/tests/__init__.py", line 26, in testImages 
    response = self.client.get(reverse('captcha-image', kwargs=dict(key=key))) 
    File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/django/test/client.py", line 439, in get 
    response = super(Client, self).get(path, data=data, **extra) 
    File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/django/test/client.py", line 244, in get 
    return self.request(**r) 
    File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response 
    response = callback(request, *callback_args, **callback_kwargs) 
    File "/Users/cnnlakshmen_2000/Projects/Permissions/captcha/views.py", line 27, in captcha_image 
    font = ImageFont.truetype(settings.CAPTCHA_FONT_PATH, settings.CAPTCHA_FONT_SIZE) 
    File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL/ImageFont.py", line 218, in truetype 
    return FreeTypeFont(filename, size, index, encoding) 
    File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL/ImageFont.py", line 134, in __init__ 
    self.font = core.getfont(file, size, index, encoding) 
    File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL/ImageFont.py", line 34, in __getattr__ 
    raise ImportError("The _imagingft C module is not installed") 
ImportError: The _imagingft C module is not installed 

但我實際上已經安裝PIL。

我輸入sudo的PIP安裝PIL,它給了我這樣的:

Requirement already satisfied (use --upgrade to upgrade): pil in /Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL 
Cleaning up... 

不知道在哪裏我的錯誤是...需要一些指導...

回答