Skip to content

Install Overview

Alexander Piskun edited this page Sep 22, 2021 · 3 revisions

Python modules short description

Python MediaDC module requires a number of packages to work, that is listed below. You can install it manually or automatically on configuration page (recommended).

Type Packages Description
required PIL, numpy Required packages for Python module to work
optional scipy, pywt, pillow_heif Optional packages for hashes and HEIC/HIF images support
boost hexhamming This packages increases hash comparison speed (x2-x8)

If you use PostgreSQL then you additional need asn1crypto. But it almost always already installed in system.

If you use MySQL/MariaDB then you optionally need(depends which authentication methods for DB you use):

cryptography, pynacl

scipy module need for phash algorithm.

pywt(named pywavelets) need for whash algorithm.

For processing HEIC(HIF) images (Apple format) need module pillow_heif.

hexhamming only need for speed up of comparing photos hashes, when amount of images in one task is more then 15k-20k. But it is fast even without it.

Auto Install algorithm

  1. Check if PIP module with version >= 19.0 is present.(Centos by default has very old PIP, so to use global PIP during auto install upgrade it)

    If PIP is ok, then step 3 will next.

  2. Download https://bootstrap.pypa.io/get-pip.py and executes it with next arguments:

    --user , --cache-dir .\local

    Python interpreter will be run with PYTHONUSERBASE=.\local

    local folder will be created near script locations, it is nextcloud/apps/mediadc/lib/Service/python

  3. After that for each Required or Optional package missing in system PIP with install <package_name> argument will be called.

    PYTHONUSERBASE=.\local will be passed to each call, so they will be installed inside that folder.

    Removing that folder is enough to revert auto install process.

  4. Each MediaDC update, all modules that was previously installed with the help of autoupdate and is missing - will be reinstalled.

    That's all!

Clone this wiki locally