I am trying to make an image gallery page with flask, I need to use pillow to resize the images to show them as thumbnails but when I try to import pillow I get an error.
I am using python3.5 and I didn't install pillow on top of the PILL I am using a ubuntu server that runs apache2. All packages are installed in a virtualenv. I tried to reinstall pillow, also tried different versions of it still does not working. It works when I try it seperately but not working with flask project. Also pip freeze shows that I have Pillow==6.1.0
I used this to install pillow:
pip install Pillow
This line gives error:
from PIL import Image
This is the error log:
Traceback (most recent call last):
File "/var/www/flaskapp/flaskapp.wsgi", line 7, in <module>
from flaskapp import app as application
File "/var/www/flaskapp/flaskapp/__init__.py", line 3, in <module>
from PIL import Image
File "/var/www/flaskapp/flaskapp/venv/lib/python3.5/site-packages/PIL/Image.py", line 95, in <module>
from . import _imaging as core
ImportError: cannot import name _imaging