Fresh Install of Seafile 11.x on Ubuntu 20.04 Fails with Python Error

I’m setting up Seafile for the first time, on Ubuntu 22.04 using a Python virtual env. Everything works great until I get to the seahub setup, which fails with error “Error happened during creating seafile admin.”

Some Googling led me to this test, which shows the problem:

$ python3 check_init_admin.py
Traceback (most recent call last):
File “/opt/seafile/seafile-server-11.0.13/check_init_admin.py”, line 19, in
from seaserv import ccnet_api
ModuleNotFoundError: No module named ‘seaserv’

And, indeed, the ‘seaserv’ module is located at /opt/seafile/lib/python3/site-packages/seaserv, outside of the Python VirtualEnv.

Have I missed a step? Or should I just manuall copy/move that library into the venv.

-Jeff

check_init_admin.py is not meant to be run on its own. It is run on every seahub startup with the correct environment.

seahub.sh:

[...]
function start_seahub () {
    before_start;
    echo "Starting seahub at port ${port} ..."
    check_init_admin;
[...]
function check_init_admin() {
    check_init_admin_script=${INSTALLPATH}/check_init_admin.py
    if ! $PYTHON $check_init_admin_script; then
        exit 1
    fi
}
[...]

The error you reported comes from within the check_init_admin.py script:

$ grep "Error happened during creating seafile admin" check_init_admin.py 
        print(Utils.highlight('Error happened during creating seafile admin.'))

You should not need a virtual environment with Ubuntu 22.04. Just make sure you installed all necessary dependencies, see: Installation with MySQL - Seafile Admin Manual

HTH!

Ubuntu 20.04 or 22.04? The title mentiones 20.04, the description 22.04 :slight_smile: