在处理验证码的时候 无法显示验证码?
来源:6-8 用户注册-2
jqlts1
2017-02-08
我代码是按照教程去敲的
但是,提示是这样的
File "/Users/fish/.pyenv/versions/testvir/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response response = self.process_exception_by_middleware(e, request) File "/Users/fish/.pyenv/versions/testvir/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/fish/.pyenv/versions/testvir/lib/python2.7/site-packages/captcha/views.py", line 67, in captcha_image font = ImageFont.truetype(fontpath, settings.CAPTCHA_FONT_SIZE * scale) File "/Users/fish/.pyenv/versions/testvir/lib/python2.7/site-packages/PIL/ImageFont.py", line 238, in truetype return FreeTypeFont(font, size, index, encoding) File "/Users/fish/.pyenv/versions/testvir/lib/python2.7/site-packages/PIL/ImageFont.py", line 127, in __init__ self.font = core.getfont(font, size, index, encoding) File "/Users/fish/.pyenv/versions/testvir/lib/python2.7/site-packages/PIL/ImageFont.py", line 37, in __getattr__ raise ImportError("The _imagingft C module is not installed") ImportError: The _imagingft C module is not installed [08/Feb/2017 12:39:14] "GET /captcha/image/0bff177380a581f1479686b3838a08124e67f896/ HTTP/1.1" 500 78122
是不是我的PIL库没有安装好?
写回答
2回答
-
bobby
2017-02-08
应该是pillow安装失败了, 你百度一下ImportError: The _imagingft C module is not installed 这个错误网上答案很多
00 -
bobby
2017-02-08
你是通过 pip install pillow安装的吗?
042017-02-09
相似问题