forked from numenta/NAB
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install_py2_detectors.sh
executable file
·36 lines (26 loc) · 1.2 KB
/
install_py2_detectors.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# This is a helper script to install python2 detectors (numenta, htmjava) if possible.
# It is done through creating a python2 virtualenv and installing the packages there.
# Requirements: virtualenv, pytnon2, bash
# If fails, nothing happens, but py2 detectors won't be usable
[ ! -x "`which virtualenv`" ] && echo "Virtualenv required!" && exit
[ ! -x "`which python2`" ] && echo "Python 2 not installed, skipping installation of python2-only detectors (numenta, numentaTM, htmjava)" && exit
REPO=`pwd`
echo $REPO
virtualenv --python=python2 ${REPO}/pyenv2
source ${REPO}/pyenv2/bin/activate
python --version
## Install Python 2 detectors:
# 1/ Numenta detector
pip install -r nab/detectors/numenta/requirements.txt
python nab/detectors/numenta/setup.py install --force
# 2/ htmjava detector
[ ! -x "`which gradle`" ] && echo "htmjava detector requires gradle to build" && exit
[ ! -x "`which java`" ] && "htmjava requires java! :) Preferably Java 8" && exit
cd ${REPO}/nab/detectors/htmjava/
gradle clean build || exit
cd ${REPO}
pip install -r nab/detectors/htmjava/requirements.txt
python nab/detectors/htmjava/setup.py install --force
echo "Installation of Py2 detectors finished:"
pip list | grep nab