gpt4 book ai didi

windows - 如何修复 "The _imaging C module is not installed"Django/WSGI/Apache

转载 作者:可可西里 更新时间:2023-11-01 10:50:16 24 4
gpt4 key购买 nike

我在使用 Windows 的家用电脑上运行我的测试站点。现在,我正在尝试缩略图,但出现错误:

The _imaging C module is not installed

但仅当我尝试通过 Apache 服务器访问 View 时。运行服务器缩略图就好了。我已经安装了其他人引用的特殊预编译二进制文件,但没有任何运气。

知道为什么它可以在 runserver/shell 而不是 Apache 中运行吗?

最佳答案

您需要在 .wsgi 配置文件的路径中包含 PIL 和其他站点包的路径。所以首先你需要找到你的站点包的位置(例如:/usr/local/lib/python2.6/site-packages/),然后将它添加到你的 .wsgi 文件中的 sys.path。示例 WSGI:

import os, sys
sys.path.append('/home/www/sites/mysite', '/usr/local/lib/python2.6/site-packages/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

关于windows - 如何修复 "The _imaging C module is not installed"Django/WSGI/Apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6397509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com