Forums

Why this error when adding image via Admin: 'Neither Pillow nor PIL could be imported: No module named 'Image'

UPDATE:

Re-installed Pillow, restarted app — it seems to have worked. I suppose restarting app was all that was needed?


I'm trying to add an image via my Admin but getting an error relating to Pillow or PIL (see below).

I just installed Pillow (pip3 install --user Pillow) but still get the error. What am I missing? (disclaimer: Django newbie)

ImproperlyConfigured at /admin/portfolio/portfolioimage/add/
Neither Pillow nor PIL could be imported: No module named 'Image'
Request Method: POST
Request URL:    http://robertanthony.pythonanywhere.com/admin/portfolio/portfolioimage/add/
Django Version: 1.6
Exception Type: ImproperlyConfigured
Exception Value:    
Neither Pillow nor PIL could be imported: No module named 'Image'
Exception Location: /usr/local/lib/python3.3/dist-packages/django/utils/image.py in _detect_image_library, line 105
Python Executable:  /usr/local/bin/uwsgi
Python Version: 3.3.2
Python Path:    
['/var/www',
 '.',
 '',
 '/usr/local/lib/python3.3/dist-packages/setuptools-2.1.2-py3.3.egg',
 '/usr/local/lib/python3.3/dist-packages/pip-1.5.2-py3.3.egg',
 '/var/www',
 '/usr/lib/python3.3',
 '/usr/lib/python3.3/plat-x86_64-linux-gnu',
 '/usr/lib/python3.3/lib-dynload',
 '/usr/local/lib/python3.3/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/home/robertanthony/portfolio']

[edit by admin: formatting]

That's right, reloading the app was almost certainly all you needed. When you install new stuff then the default Python module load path can change, and to refresh that you have to reload. The same thing applies to any Python process that's currently running -- so Python consoles can need restarting too.