0

I am trying to deploy Django Inventory with Apache + Mod_wsgi in Virtual environment. But It gives 500 server side error claiming that it cannot import PIL. But PIL and Photologue are already installed within my virtualenv. And I had no problem getting a hello-world project running within this setup.

FYI: Django Inventory itself installs as an app when installed with pip. And resides in the site-packages of the virtual-environment. But I have copied it fro the ste packages and put it in the /var/www/html root to serve from apache. Could this be a reason?

Thanks in advance.

[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.
edam
  • 910
  • 10
  • 29
  • Check if PIL is referenced in your Python path. Also consider using pillow instead of PIL. – user937284 Jun 21 '16 at 12:24
  • @Ёжик Yeah I already installled pillow (which actually brings PIL). But what about checking for if PIL is in my Python Path? I already have said that I can import it from shell. Could you please clarify? – edam Jun 21 '16 at 12:35

1 Answers1

0

This is probably not the answer that you're looking for, but...

Django-photologue 2.3 is a really old version - about 6 years old.

Installing PIL was often troublesome; I am the maintainer of Django-photologue since 2012, and I've had to write some ugly code in order to import PIL correctly (the installation path tended to change from installation to installation). I think it was in version 2.6 that I made these changes.

Nowadays everyone just uses Pillow instead :-)

By the way, I looked at the requirements file for django-inventory and it uses very old 3rd party software. For example, Django 1.6 - which is no longer supported.

Richard Barran
  • 331
  • 2
  • 6
  • Then what is suggestion? Should I port django inventory to with the newest django varsion (1.9> )? – edam Jun 23 '16 at 12:16
  • You're already having difficulties because you are using really old software... it's possible that you're going to encounter more issues :-) – Richard Barran Jun 24 '16 at 13:36