Skip to content

Commit

Permalink
[Mod] update install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Edanflame committed Dec 14, 2021
1 parent 88fc1f2 commit 7c8a8a4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 32 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,15 @@ vn.py是一套基于Python的开源量化交易系统开发框架,在开源社

**Windows**

install.bat
```
install.bat
```

**Ubuntu**

bash install.sh
```
. install.sh
```

**Macos**

Expand Down
14 changes: 12 additions & 2 deletions README_ENG.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,21 @@ Download the latest version from [here](https://github.com/vnpy/vnpy/releases),

**Windows**

install.bat
```
install.bat
```

**Ubuntu**

bash install.sh
```
. install.sh
```

**Macos**

```
bash install_osx.sh
```

## User's Guide

Expand Down
2 changes: 1 addition & 1 deletion install.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:: Upgrade pip & setuptools
python -m pip install --upgrade pip setuptools
python -m pip install --upgrade pip setuptools wheel

::Install prebuild wheel
python -m pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
Expand Down
24 changes: 13 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,37 @@ prefix=$2
shift 2

[[ -z $python ]] && python=python
[[ -z $prefix ]] && prefix=/usr
[[ -z $prefix ]] && prefix=~/usr/talib

$python -m pip install --upgrade pip setuptools wheel

# Get and build ta-lib
function install-ta-lib()
{
pushd /tmp
{
# 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()
{
ta-lib-config --libs > /dev/null
$prefix/ta-lib-config --libs > /dev/null
}
ta-lib-exists || install-ta-lib

# old versions of ta-lib imports numpy in setup.py
$python -m pip install numpy

# Install extra packages
$python -m pip install ta-lib
$python -m pip install psycopg2-binary

# Install Python Modules
$python -m pip install -r requirements.txt

Expand Down
22 changes: 6 additions & 16 deletions install_osx.sh
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
#!/usr/bin/env bash

python=$1
prefix=$2
shift 2
shift 1

[[ -z $python ]] && python=python
[[ -z $prefix ]] && prefix=/usr

$python -m pip install --upgrade pip setuptools wheel

# Get and build ta-lib
function install-ta-lib()
{
pushd /tmp
curl https://pip.vnpy.com/colletion/ta-lib-0.4.0-src.tar.gz --output 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 -j
make install
popd
export HOMEBREW_NO_AUTO_UPDATE=true
brew install ta-lib
}
function ta-lib-exists()
{
ta-lib-config --libs > /dev/null
}
ta-lib-exists || install-ta-lib

# old versions of ta-lib imports numpy in setup.py
$python -m pip install numpy

# Install extra packages
$python -m pip install ta-lib
# install ta-lib
$python -m pip install numpy==1.18.2
$python -m pip install ta-lib==0.4.17

# Install Python Modules
$python -m pip install -r requirements.txt
Expand Down

0 comments on commit 7c8a8a4

Please sign in to comment.