I followed the directions on Installation - Seafile Admin Manual 3 # Installation of Seafile Server Community Edition with MySQL/MariaDB

I’m following the directions to do an insall and I’m executing the

# install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide).
pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \
    pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \
    psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.9.* pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 lxml python-ldap==3.4.* gevent==24.2.*

I keep getting the following error

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/opt/seafile/python-venv/lib/python3.12/site-packages/pytz'
Check the permissions.

The entire block in the instructions reads

udo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev python3.12-venv default-libmysqlclient-dev build-essential pkg-config libmemcached-dev

mkdir /opt/seafile
cd /opt/seafile

# create the vitual environment in the python-venv directory
python3 -m venv python-venv

# activate the venv
source python-venv/bin/activate
# Notice that this will usually change your prompt so you know the venv is active

# install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide).
pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \
    pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \
    psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.9.* pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 lxml python-ldap==3.4.* gevent==24.2.*

I don;t see any permissions given I am logged in as administrator *which is not root but can sudo)

Any help is appreciated

That looks like the permissions are wrong on the python-venv directory. This could happen if you ran “python3 -m venv python-venv” as root (or with sudo).

All you should need to do to fix it so the pip install will work is to run “sudo chown -R username /opt/seafile”, but put your username in where I put “username”.

I tried that but it didn’t work

I removed /opt/seafile and started again. As a non root user “admin” i follow the instructions

https://manual.seafile.com/12.0/setup_binary/installation_ce/#__tabbed_1_1
 
sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev python3.12-venv default-libmysqlclient-dev build-essential pkg-config libmemcached-dev

mkdir /opt/seafile
cd /opt/seafile

but the mkdir /opt/seafile fails for permissions denied

Is this an error in the instructions and how do I get around it?

Yeah, It think that’s a flaw in the instructions.

I think all you need to do is these steps in place of the mkdir from the instructions:

sudo mkdir /opt/seafile
sudo chown -R username /opt/seafile
cd /opt/seafile

And then back to the normal steps from there.

Thanks for the reply

Now I’m faces with (python-venv) seafile@fluffy:~/seafile-server-latest$ ./seahub.sh start

Cannot find JWT_PRIVATE_KEY value from environment, try to read .env file.
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …


It’s the first time you start the seafile server. Now let’s create the admin account

What is the email for the admin account?
[ admin email ] emailaddr

What is the password for the admin account?
[ admin password ]

Enter the password again:
[ admin password again ]
Error happened during creating seafile admin.
Seahub is started
Done.

I even tried
mysql> ALTER USER ‘seafile’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘mypassword’;
Query OK, 0 rows affected (0.11 sec)

mysql> Flush the privileges

I see this in the log seafile-monitor.log

[2025-06-14 13:14:43] Start seafevents.main
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/opt/seafile/seafile-server-12.0.14/pro/python/seafevents/main.py”, line 6, in
from seafevents.db import create_db_tables, prepare_db_tables
File “/opt/seafile/seafile-server-12.0.14/pro/python/seafevents/db.py”, line 7, in
from sqlalchemy import create_engine
ModuleNotFoundError: No module named ‘sqlalchemy’
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 228, in partial_apport_excepthook
return apport_excepthook(binary, exc_type, exc_obj, exc_tb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 114, in apport_excepthook
report[“ExecutableTimestamp”] = str(int(os.stat(binary).st_mtime))
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘/opt/seafile/seafile-server-12.0.14/-m’

Original exception was:
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/opt/seafile/seafile-server-12.0.14/pro/python/seafevents/main.py”, line 6, in
from seafevents.db import create_db_tables, prepare_db_tables
File “/opt/seafile/seafile-server-12.0.14/pro/python/seafevents/db.py”, line 7, in
from sqlalchemy import create_engine
ModuleNotFoundError: No module named ‘sqlalchemy’

I switched to running the Docker version for seafile version 12 (in podman because I just don’t like docker). So I haven’t done an install like this since version 11. But I took a few minutes to try it out to see if I can find why it isn’t going right for you.

I don’t see what distribution you are using, so I went with my usual Debian (debian 12). I was able to mostly follow the official instructions, except these differences:

  • The change from above with setting the directory owner so the venv dir works.
  • Add a password to the root user in mariadb so the setup-seafile-mysql.sh script can log into the database as root:
sudo mariadb
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root-password-here';
  • A few minor changes to the config because I wasn’t using a reverse proxy for this little test.

Other than that, it worked for me. Setting the password for root in mariadb might get you past the first, but I doubt it will help with that second problem. I don’t really have a good guess for what’s going on with that, and will probably need some more clues before I can come up with a guess.

I’m using ubuntu 24.04.2 with mysql not maria seafile 12.0.14_x86-64

I have wiped the drive and started from scratch about a dozen times whats one more time

maybe I’ll try to reinstall again and try mariadb this time