树莓派安装完成, seahub.sh 打开失败


#1

root@raspberrypi:/opt/seafile/seafile-server-8.0.5# ./seahub.sh start-fastcgi

Starting seahub (fastcgi) at 127.0.0.1:8000 …
Traceback (most recent call last):
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/MySQLdb/init.py”, line 18, in
from . import _mysql
ImportError: cannot import name ‘_mysql’ from ‘MySQLdb’ (/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/MySQLdb/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-server-8.0.5/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/core/management/init.py”, line 357, in execute
django.setup()
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/apps/registry.py”, line 114, in populate
app_config.import_models()
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/apps/config.py”, line 211, 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 “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/contrib/sessions/models.py”, line 1, in
from django.contrib.sessions.base_session import (
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/contrib/sessions/base_session.py”, line 26, in
class AbstractBaseSession(models.Model):
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/models/base.py”, line 117, in new
new_class.add_to_class(’_meta’, Options(meta, app_label))
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/models/base.py”, line 321, in add_to_class
value.contribute_to_class(cls, name)
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/models/options.py”, line 204, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/init.py”, line 28, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/utils.py”, line 201, in getitem
backend = load_backend(db[‘ENGINE’])
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/utils.py”, line 110, in load_backend
return import_module(’%s.base’ % backend_name)
File “/usr/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/django/db/backends/mysql/base.py”, line 15, in
import MySQLdb as Database
File “/opt/seafile/seafile-server-8.0.5/seahub/thirdpart/MySQLdb/init.py”, line 24, in
version_info, _mysql.version_info, _mysql.file
NameError: name ‘_mysql’ is not defined
Error:Seahub failed to start.


#2

pip3 install mysqlclient


#3

mypy-extensions 0.4.1
mysqlclient 2.0.3
networkx 2.5.1
nudatus 0.0.4
numpy 1.21.0
oauthlib 2.1.0
olefile 0.46
pantilthat 0.0.7
parso 0.3.1
pexpect 4.6.0
pgzero 1.2
phatbeat 0.1.1
pianohat 0.1.0
picamera 1.13
pickleshare 0.7.5
picraft 1.0
piglow 1.2.5
pigpio 1.78
Pillow 8.3.1
pip 21.1.3
prompt-toolkit 1.0.15


#4

我也碰到这个问题, 到处搜,安装了一堆东西也没有解决, 最后的解决办法:

apt-get install libmariadb3 libmariadb-dev

你可以先装第一个libmariadb3, 不行在安装第二个libmariadb-dev

试试吧

我前面还升级了Django, 命令 pip install Django==2.2.24