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

1 Like


Sorry for opening again such an old topic, but I’m facing the exact same issue with SeaFile 9.0.2…
Unfortunately none of the workarounds given here worked for me :cry:

Any suggestion ?


Hi Brice,

I wish I could help you but due the time that has past I cannot remember any longer what the solution was. I’m very sorry for this. Wish you good luck.

Though, as I Failed to do so, I’d as you to post an answer here if you do figure it out such that others may not find themselves in the situation we were both in.

1 Like

What system are you using?
Did you do a fresh install of 9.0.2 or upgraded an existing installation? (If you upgraded, what was the last working version?)
Without any additional information, I doubt anyone will be able to help you.

You’re right @squirrel , sorry…
I posted also on another topic so I forgot to mention some points.
I’m using a Raspberry PI 3 running Raspberry Pi OS Buster.
I’m trying a fresh install of 9.0.2.

I did a little digging in the script, where I found that the path to PYTHON packages is wrong, because it is searching for <install_path>/seafile/lib64/python3, where there is no lib64 folder.
So I modified the script to target the correct path, but after that I’m facing another issue which is the following one:

Traceback (most recent call last):
  File "/seafile/seafile-server-9.0.2/", line 19, in <module>
    from seaserv import ccnet_api
ModuleNotFoundError: No module named 'seaserv'

I’m a bit lost here… :frowning:

This is so frustrating… :angry:

If I modify the script to set the PYTHONPATH to
I’m then getting the error mentionned here with the module ‘Image’ not found, but if I modify the script that way:
it is bypassing the search for Image (or doesn’t reach it I don’t know), and I get the error module seaserv not found…


I don’t have a buster system and I don’t know exactly what’s going on, but I saw that the error you posted in the other thread included:

ImportError: cannot open shared object file: No such file or directory

Did you install libopenjpg2-7 (didn’t check what the correct package name for buster is) or something along those lines providing the file? Not sure whether this is necessary or not and whether this in included in the guide you used.

Tbh: I don’t recall exactly whether I had to install the library and I’m not sure it helps, but I figure it’s worth a try.

Good catch !
I’ve installed libopenjp2-7, and then I got this:
Unknown command: 'runfcgi'
Then tried by launching normally seahub with the start option, instead of start-fastcgi as it is suggested when something goes wrong, and yeah ! It works ! :hugs:
Thanks a lot ! The answer was in front of my noze, couldn’t see it :stuck_out_tongue_closed_eyes:

start-fastcgi is deprecated. But (I don’t know why) it gives a more verbose output than the regular start before it itself fails (due to being deprecated). That’s why you get the “unknown command runfcgi”

Glad you got it working.

Thank you a lot, I´ve had the exact same issue with upgrading to 9.0.2.