haiwen / seafile-rpi

Seafile server package for Raspberry Pi.
Other
559 stars 89 forks source link

ModuleNotFoundError: No module named 'seaserv' #71

Closed PDiracDelta closed 3 years ago

PDiracDelta commented 3 years ago

I tried to install Seafile 8.0.0 from source with SQLite on RPI 2B (Raspberry Pi OS). I used the build3.sh script. Starting seafile.sh works. When starting seahub.sh, it throws an error: ModuleNotFoundError: No module named 'seaserv' I can see that the seaserv dir is present in haiwen-build/seafile-server/python/seaserv but apparently it was not automatically installed into Python.

How can I fix this / can you make sure it is automatically installed?

EDIT: I'm confused. I see that seafile-server-8.0.0/seafile/lib contains python2.7. Isn't it supposed to use Python3?

Gustl22 commented 3 years ago

I think this is due to hardcoded links in seafile-server. https://github.com/haiwen/seafile/issues/2399

If the manual linking doesn't help, try to install at least python 3.6. https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux

Anyways @jobenvil and me will try to release the 8.0.1 soon, when I have my builds finished.

jobenvil commented 3 years ago

@Gustl22 suggestion is totally right, just do ln -s python3.8 python3.6 or whatever python version you have.

PDiracDelta commented 3 years ago

@Gustl22 @jobenvil thanks for the tip, however, I did this linking in /usr/lib /usr/bin /usr/share/lib /usr/local/lib and /etc and I still get the same error message... I have python3.7 and linked to it btw.

Should I re-install seahub after this linking? Why would installing python3.6 help (but not linking)?

jobenvil commented 3 years ago

@PDiracDelta maybe it was not clear enough. I mean linking like that:

jobenvil@hiperborea /media/sda/seafile/seafile-server-latest/seafile/lib $ ll | tail
-rw-r--r-- 1 seafile seafile    50604 Dez  8 21:19 libtasn1.so.6
-rw-r--r-- 1 seafile seafile  1422692 Dez  8 21:19 libunistring.so.2
-rw-r--r-- 1 seafile seafile    21968 Dez  8 21:19 libuuid.so.1
-rw-r--r-- 1 seafile seafile   161140 Dez  8 21:19 libwind.so.0
-rw-r--r-- 1 seafile seafile  1084332 Dez  8 21:19 libxml2.so.2
-rw-r--r-- 1 seafile seafile    75340 Dez  8 21:19 libz.so.1
-rw-r--r-- 1 seafile seafile   435576 Dez  8 21:19 libzstd.so.1
drwxrwxr-x 2 seafile seafile     4096 Dez  8 21:18 pkgconfig
lrwxrwxrwx 1 seafile seafile        9 Dez  8 22:43 python3.6 -> python3.8
drwxrwxr-x 3 seafile seafile     4096 Dez  8 21:15 python3.8

Should I re-install seahub after this linking? Why would installing python3.6 help (but not linking)?

No re-install, just start seahub again.

If you install python3.6 in your compiling environment, the resulting seafile package will habe already the directory "python3.6" inside the directory /media/sda/seafile/seafile-server-latest/seafile/lib, like this:

jobenvil@hiperborea /media/sda/seafile/seafile-server-latest/seafile/lib $ ll | tail
-rw-r--r-- 1 seafile seafile    50604 Dez  8 21:19 libtasn1.so.6
-rw-r--r-- 1 seafile seafile  1422692 Dez  8 21:19 libunistring.so.2
-rw-r--r-- 1 seafile seafile    21968 Dez  8 21:19 libuuid.so.1
-rw-r--r-- 1 seafile seafile   161140 Dez  8 21:19 libwind.so.0
-rw-r--r-- 1 seafile seafile  1084332 Dez  8 21:19 libxml2.so.2
-rw-r--r-- 1 seafile seafile    75340 Dez  8 21:19 libz.so.1
-rw-r--r-- 1 seafile seafile   435576 Dez  8 21:19 libzstd.so.1
drwxrwxr-x 2 seafile seafile     4096 Dez  8 21:18 pkgconfig
lrwxrwxrwx 1 seafile seafile        9 Dez  8 22:43 python3.6   # here you will have python3.6 instead of python3.7
PDiracDelta commented 3 years ago

OK @jobenvil , I understand now I should link it in the seafile/lib folder. However, as mentioned in the original post I don't have any python3 there, only python2.7 !? Sorry if that's something I did wrong; I'm not very familiar with building my own things from source, but I assumed using the build3 script and unpacking the tar.gz would do the trick. I definitely had python3.7 while building the package. Perhaps you hard-linked to 3.6 in the build script too? In that case, should I re-build it now, as I have the links in-place everywhere on my system? I'm guessing that copy-pasting or linking a python3.6 dir in seafile/lib is too late now.

jobenvil commented 3 years ago

yes, if you have just python2.7 inside /seafile/lib it means that it was compiled using python2.7 instead of python3.6+

You need to compile again but before to start the build3.sh script you need to ensure that python3 is the default python in your environment.

Which os distro do you use?

PDiracDelta commented 3 years ago

Ah, yes, it seems python2.7 was still the default. I'm using Raspberry Pi OS. Not sure why they would do that... but perhaps worth mentioning in the tutorial for 8.0, I suspect many will have this issue. OK, I'll rebuild and update this soon.

PDiracDelta commented 3 years ago

This works. I have another issue now, but I'll open another ticket.