Seafile-Server-Installer CentOS Python Path enviroment Error

Hey everyone,

i wanted to use the Seafile installer on a Fresh CENTOS Container, but the installer stops always at “PYTHON in PATH not set correct”

if i do an “echo $PATH” i get an “/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/python” back
so i think its set right

if i do an “echo $PYTHON” it returns nothing

an “python -V” returns “Python 2.7.5”

can someone help me to troubleshoot this?
thanks a lot

Why do you have “/usr/bin/python” in your PATH? On my SL7 installation I have:

[root@vm ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@vm ~]# echo $PYTHON

[root@vm ~]# whereis python
python: /usr/bin/python2.7 /usr/bin/python /usr/bin/python2.7-config /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz

i put it there after several attempts to install the seafile-server with the install script.
i definitly got seafile installed several times just run the script on a fresh centos installation, and i dont know whats changed…:frowning:

whereis python
python: /usr/bin/python2.7 /usr/bin/python /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz

seems like the same…

the installation aborts exactly at the check from line 91 in this Seafile Script and throws me exactly that error, but why?

i ended up with a debian stretch and used the ubuntu script to set it up! something seems broken with the centos script in my case.
i still dont understand the reasons for recommend using ubuntu 16.04 as a server installation. in my opinion debian or centos are the better choices! a pitty that the centos one isnt working…

1 Like

They are mostly devs and don’t know it better I think. Debian is listed as supported but not recommended.

Put “set -x” into the setup script and look at the output:

setup-seafile.sh:

#!/bin/bash
set -x

On my Scientific Linux 7.4 installation it runs without any problems.

...    
    + check_python
    + echo 'Checking python on this machine ...'
    Checking python on this machine ...
    + check_python_executable
    + [[ '' != '' ]]
    + which python2.7
    + PYTHON=python2.7
    + echo 'Find python: python2.7'
    Find python: python2.7
    + echo
    ...

so, this is the point where it stops…

+ systemctl start mariadb
+ systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
++ pwgen
+ SQLROOTPW=Chood3nu
+ mysqladmin -u root password Chood3nu
+ cat
+ chmod 600 /root/.my.cnf
+ cat
+ systemctl enable seafile
Created symlink from /etc/systemd/system/multi-user.target.wants/seafile.service to /etc/systemd/system/seafile.service.
+ cat
+ systemctl enable seahub
Created symlink from /etc/systemd/system/multi-user.target.wants/seahub.service to /etc/systemd/system/seahub.service.
+ cat
+ chmod 700 /usr/local/sbin/seafile-server-restart
+ mkdir -p /opt/seafile/installed
+ cd /opt/seafile/
+ is_pro
+ [[ 0 == \1 ]]
+ return 1
+ [[ ! -e /opt/seafile-server_6.2.5_x86-64.tar.gz ]]
+ curl -OL https://download.seadrive.org/seafile-server_6.2.5_x86-64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24.9M  100 24.9M    0     0  14.1M      0  0:00:01  0:00:01 --:--:-- 14.0M
+ tar xzf seafile-server_6.2.5_x86-64.tar.gz
+ mv seafile-server_6.2.5_x86-64.tar.gz installed
+ [[ -f /opt/seafile.my.cnf ]]
+ echo 'MariaDB installed before, skip this part'
MariaDB installed before, skip this part
++ sed -n s/password=//p /opt/seafile.my.cnf
+ SQLSEAFILEPW=ooFied4u
+ useradd --system --comment seafile seafile --home-dir /opt/seafile
+ cd /opt/seafile/seafile-server-6.2.5/
++ dirname /opt/seafile/seafile-server-6.2.5/
+ TOPDIR=/opt/seafile
+ DEFAULT_CONF_DIR=/opt/seafile/conf
+ SEAFILE_DATA_DIR=/opt/seafile/seafile-data
+ DEST_SETTINGS_PY=/opt/seafile/conf/seahub_settings.py
+ mkdir -p /opt/seafile/conf
+ ./setup-seafile-mysql.sh auto -u seafile -w ooFied4u -r Chood3nu
Checking python on this machine ...

Can't find a python executable of version 2.7 or above in PATH
Install python 2.7+ before continue.
Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it

From the terminal, type the following command and let us know the output:

type -a python

Yup… you actually type “type” in there. :wink:

Also, can you do a echo $PATH for me?

there you go:

type -a python
python is /usr/bin/python

i did an echo $PATH already (see first post)
but here you go again:

echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin

Yeah, but it was dated back in March, so I wanted to make certain that the path had not changed. Does Python run properly from a command line? If so, what version does it report?

version is 2.7.5

could it be that i took seafile version 6.2.5 instead of 6.1.2 like the example at github?

will check that soon

I’m not certain what you are talking about. Can you provide a link to the github issue you mentioned?

I’m running 2.7.13 of Python, and 6.2.5 of the server, and it’s working fine.

As for how the seafile script checks for Python version, it does this:

which python2.7

It also tries

which python27

If neither of those return a response for your python executable, then you will get that fail message.

From the command line, try both those commands and let me know what it returns.

I know its a little bit late but hope this answer help other people at least.

On CentOS 7, the which command is not installed by default. If you do not install it you will get the error:

Checking python on this machine …
Can’t find a python executable of version 2.7 or above in PATH
Install python 2.7+ before continue.
Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it

Simply type “yum install which” and that should fix it.

Regards

2 Likes

damn! that did the trick! thanks a hundred times!