forked from Sakura-Fire-Capital/vnpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
46 lines (36 loc) · 1.01 KB
/
install.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
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
python=$1
prefix=$2
shift 2
[[ -z $python ]] && python=python
[[ -z $prefix ]] && prefix=~/usr/talib
$python -m pip install --upgrade pip wheel
# Get and build ta-lib
function install-ta-lib()
{
# install numpy first
$python -m pip install numpy==1.18.2
mkdir -p $prefix
pushd $prefix
wget https://pip.vnpy.com/colletion/ta-lib-0.4.0-src.tar.gz
tar -xf ta-lib-0.4.0-src.tar.gz
cd ta-lib
./configure --prefix=$prefix
make -j1
make install
popd
echo "export LD_LIBRARY_PATH=$prefix/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
export LD_LIBRARY_PATH=$prefix/lib:\$LD_LIBRARY_PATH
CPPFLAGS="-I$prefix/include" LDFLAGS="-L$prefix/lib" pip install ta-lib==0.4.17
}
function ta-lib-exists()
{
$prefix/ta-lib-config --libs > /dev/null
}
ta-lib-exists || install-ta-lib
# Install Python Modules
$python -m pip install -r requirements.txt
# Install local Chinese language environment
locale-gen zh_CN.GB18030
# Install VeighNa
$python -m pip install .