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/models.py", line 23, in <module>
    from PIL import Image
  File "/home/seafile/installed/seahub/thirdpart/PIL/Image.py", line 93, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/home/seafile/installed/seahub/thirdpart/PIL/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/seafile/installed/seahub/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/seafile/installed/seahub/thirdpart/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/seafile/installed/seahub/thirdpart/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/home/seafile/installed/seahub/thirdpart/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/seafile/installed/seahub/thirdpart/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/home/seafile/installed/seahub/thirdpart/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", 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/models.py", 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)

/home/seafile/installed/seahub/thirdpart/PIL/

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