Seahub failed to start - no module named 'Image'

I’m installing seafile on my rpi with python 3.7 but i’m getting the following message on starting the seahub with start-fastcgi.

Traceback (most recent call last):
  File "/home/seafile/installed/seahub/seahub/avatar/", line 23, in <module>
    from PIL import Image
  File "/home/seafile/installed/seahub/thirdpart/PIL/", line 93, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/home/seafile/installed/seahub/thirdpart/PIL/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/seafile/installed/seahub/", line 10, in <module>
  File "/home/seafile/installed/seahub/thirdpart/django/core/management/", line 364, in execute_from_command_line
  File "/home/seafile/installed/seahub/thirdpart/django/core/management/", line 338, in execute
  File "/home/seafile/installed/seahub/thirdpart/django/", line 27, in setup
  File "/home/seafile/installed/seahub/thirdpart/django/apps/", line 108, in populate
  File "/home/seafile/installed/seahub/thirdpart/django/apps/", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.7/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/seafile/installed/seahub/seahub/avatar/", line 26, in <module>
    import Image
ModuleNotFoundError: No module named 'Image'

I installed both Pillow and Image but nothing seems to work. This solution was based on:
seafile topic #10227

What is going wrong, the pi says that the requirement is already satisfied when installing Image and Pillow both for pip and pip3.

I’m not sure it’s the correct way, but my workaround worked for me…

I renamed the folder (in your case)


to something like
/home/seafile/installed/seahub/thirdpart/PIL.old (in order to be able to restore everything).
This way, python isn’t finding PIL inside the seafile server installation files and looks for the user/system-installed version.

You can give it a try, for me it worked. And if it doesn’t work, just re-rename your folder and nothing changed…

You should try this first

pip3 install -U Pillow -t /media/sda/seafile/seafile-server-latest/seahub/thirdpart