Seafile pro 7.1.5. /pro/pro.py virus_scan not work

Hey I installed Seafile Server Pro on my debian and when I try to run ./pro/pro.py virus_scan output is: No module named parse

I use clamav (clamd). Can give me advice someone? Where is the issue?

Hi,

just a guess as I’m not using the pro server / virus scan.

The error says “no module named parse”, i.e., python cannot find the module.

It looks like parse is part of the urllib python module.

Maybe you can try installing the package.
Again, just a guess. Good luck :slight_smile:

Hi
Which package do you mean? Do you mean reinstall whole seafile server?

I meant the python3-urllib3 debian package
((sudo) apt-get install python3-urllib3)

This is because they have strangely limited search for Python 3 executables in get_python_executable() function (lines 288-304) in pro.py. There is only “python3.6” in the list (line 291). Recent Debian does not have python3.6, but it still has python2 as its default python interpreter:

root@server:~# ls -la /usr/bin/python
lrwxrwxrwx 1 root root 7 Mar 4 2019 /usr/bin/python -> python2

This means that searching for python3.6 fails and falls back to python executable (line 291) - which is python2.

You can:

  1. Override it by defining PYTHON variable on command line:
    PYTHON=python3 ./pro/pro.py virus_scan
  2. Add PYTHON variable permanently to your environment - this could affect other scripts which could rely on PYTHON variable
  3. Switch default python system-wide by running update-alternatives --config python. Be careful, though - this could affect scripts and utilities which are not yet ported to Python 3
  4. Add python3 into the search list in pro.py (line 291) - something along the lines:
try_list = [
      'python3', 'python3.6'
]

But this gets overriden on each upgrade

1 Like