I am running a linux box with ubuntu 14, it runs an apache2 server that hosts a Django application. This application imports PIL from the installed Pillow library. It was all working fine when I was on Python 3.5, however after upgrading to Python 3.6 and reinstalling Pillow in the Virtualenv, I get an error when the webserver tries importing PIL.
When I run the Python interpreter it all imports fine as it uses the py script directly however as the webserver is using the installed and compiled pillow library it is failing. The error from Django shows the stack as such:
Internal Server Error: /ticket-printing/
Traceback (most recent call last):
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/ipos/tickets/views.py", line 30, in stic_app
PrintList.initiateSticApp(request)
File "/home/ubuntu/ipos/tickets/models.py", line 434, in initiateSticApp
BrandLogo.createBlankLogo()
File "/home/ubuntu/ipos/store_admin/brands/models.py", line 108, in createBlankLogo
from PIL import Image
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/Pillow-4.1.0-py3.6-linux-x86_64.egg/PIL/Image.py", line 56, in <module>
from . import _imaging as core
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/Pillow-4.1.0-py3.6-linux-x86_64.egg/PIL/_imaging.py", line 7, in <module>
__bootstrap__()
File "/home/ubuntu/ipos-venv/lib/python3.6/site-packages/Pillow-4.1.0-py3.6-linux-x86_64.egg/PIL/_imaging.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
ImportError: /home/ubuntu/ipos-venv/lib/python3.6/site-packages/Pillow-4.1.0-py3.6-linux-x86_64.egg/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_AdjustIndices
I've tried uninstalling, reinstalling Pillow via pip, easy_install and the tar.gz setup.py method and all fail.
Any guidance and help would be much appreciated.
Thanks