我正在尝试在虚拟环境中使用 Apache + Mod_wsgi部署Django Inventory 。但它给出了 500 个服务器端错误,声称它无法导入 PIL。但是 PIL 和 Photologue 已经安装在我的 virtualenv 中。我在这个设置中运行一个 hello-world 项目没有问题。
仅供参考:当使用 pip 安装时,Django Inventory 本身会作为应用程序安装。并驻留在虚拟环境的站点包中。但是我已经从 ste 包中复制了它,并将其放在 /var/www/html 根目录中以从 apache 提供服务。这可能是一个原因吗?
提前致谢。
[Tue Jun 21 10:50:24.308075 2016] [wsgi:error] [pid 19197] [remote ::1:224] File "/var/www/html/imsenv/lib/python2.7/site-packages/django_inventory/apps/photos/models.py", line 6, in <module>
[Tue Jun 21 10:50:24.308099 2016] [wsgi:error] [pid 19197] [remote ::1:224] from photologue.models import ImageModel
[Tue Jun 21 10:50:24.308108 2016] [wsgi:error] [pid 19197] [remote ::1:224] File "/var/www/html/imsenv/lib/python2.7/site-packages/photologue/models.py", line 33, in <module>
[Tue Jun 21 10:50:24.308131 2016] [wsgi:error] [pid 19197] [remote ::1:224] raise ImportError('Photologue was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.')
[Tue Jun 21 10:50:24.308170 2016] [wsgi:error] [pid 19197] [remote ::1:224] ImportError: Photologue was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.