diff --git a/analytics/Compilation.md b/analytics/Compilation.md index e2a5345..f2e54d4 100644 --- a/analytics/Compilation.md +++ b/analytics/Compilation.md @@ -1,12 +1,12 @@ # Compilation -We use [pyinstaller](https://www.pyinstaller.org/) to compile analytics unit into binary file supported by *nix systems with all the dependencies. +We use [pyinstaller](https://www.pyinstaller.org/) to compile analytics unit into binary file with all the dependencies. + +Compiled module is supported by all *nix systems. ```bash -pip install pyinstaller -echo "hiddenimports=['pandas._libs.tslibs.timedeltas', 'scipy._lib.messagestream']" | cat > $PYTHON_SITE_PACKAGES/PyInstaller/hooks/hook-pandas.py +pip3 install pyinstaller cd $HASTIC_SERVER_PATH/analytics -pyinstaller worker.py +pyinstaller --additional-hooks-dir=pyinstaller_hooks worker.py ``` -On Ubuntu 16.04 $PYTHON_SITE_PACKAGES directory located at `~/.local/lib/python3.5/site-packages` diff --git a/analytics/pyinstaller_hooks/hook-pandas.py b/analytics/pyinstaller_hooks/hook-pandas.py new file mode 100644 index 0000000..a03a947 --- /dev/null +++ b/analytics/pyinstaller_hooks/hook-pandas.py @@ -0,0 +1 @@ +hiddenimports=['pandas._libs.tslibs.timedeltas'] diff --git a/analytics/pyinstaller_hooks/hook-scipy.py b/analytics/pyinstaller_hooks/hook-scipy.py new file mode 100644 index 0000000..5c8766b --- /dev/null +++ b/analytics/pyinstaller_hooks/hook-scipy.py @@ -0,0 +1 @@ +hiddenimports=['scipy._lib.messagestream'] diff --git a/analytics/pyinstaller_hooks/hook-sklearn.py b/analytics/pyinstaller_hooks/hook-sklearn.py new file mode 100644 index 0000000..8bda3d1 --- /dev/null +++ b/analytics/pyinstaller_hooks/hook-sklearn.py @@ -0,0 +1,3 @@ +from PyInstaller.utils.hooks import collect_submodules + +hiddenimports = collect_submodules('sklearn')