更新
This commit is contained in:
parent
02edb869c2
commit
f4df43e423
42
README.md
42
README.md
@ -62,6 +62,7 @@ QQ/Wechat:28888502
|
||||
# 安装解压包支持
|
||||
yum install bzip2.x86_64
|
||||
# 安装nodejs,支持request
|
||||
wget -qO- https://rpm.nodesource.com/setup_8.x | bash -
|
||||
yum -y install nodejs
|
||||
(如果安装不了,更新yum后再安装)
|
||||
# 支持ssl
|
||||
@ -85,7 +86,6 @@ QQ/Wechat:28888502
|
||||
激活py35
|
||||
source activate py35
|
||||
|
||||
|
||||
# 1.3 编译ctp的api
|
||||
cd /home/trade/vnpy-master
|
||||
cd vnpy/api/ctp
|
||||
@ -121,6 +121,16 @@ QQ/Wechat:28888502
|
||||
# 1.5 运行vnpy无界面
|
||||
(py35)/home/trade/vnpy-master/Examples/
|
||||
|
||||
# 编译ctp的api(运行用户,例如trade)
|
||||
cd /home/trade/vnpy-master
|
||||
cd vnpy/api/ctp
|
||||
激活python环境
|
||||
source activate py35
|
||||
sh build.sh
|
||||
cd vnctptd/test
|
||||
修改tdtest.py,填写账号和ip等信息
|
||||
python tdtest.py 验证 ctp api是否正常。
|
||||
|
||||
#2、Ubuntu的环境
|
||||
|
||||
sudo apt-get install gcc
|
||||
@ -137,10 +147,24 @@ QQ/Wechat:28888502
|
||||
sudo apt-get install nodejs
|
||||
sudo apt-get update && sudo apt-get install build-essential
|
||||
|
||||
# 安装anaconda并创建py35虚拟环境(trade 用户)
|
||||
# 编译CTP API(见上)
|
||||
# 安装vnpy其他需要的包(见上)
|
||||
#3、创建多版本环境:
|
||||
|
||||
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.3.1-Linux-x86_64.sh
|
||||
chmod a+x Anaconda3-4.3.1-Linux-x86_64.sh
|
||||
./Anaconda3-4.3.1-Linux-x86_64.sh
|
||||
|
||||
# 配置为国内的镜像
|
||||
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
|
||||
conda config --set show_channel_urls yes
|
||||
|
||||
选择其中一个来创建
|
||||
conda create --name py35 python=3.5
|
||||
|
||||
激活的例子
|
||||
source activate py35
|
||||
|
||||
升级虚拟环境得pip
|
||||
pip install --upgrade pip
|
||||
|
||||
#3、碰到的问题:找不到vnpy.xx.xx(原2.7环境)
|
||||
可能你使用了vnpy的原版,安装到conda环境中了。需要先卸载 pip uninstall vnpy
|
||||
@ -163,10 +187,20 @@ QQ/Wechat:28888502
|
||||
如果你安装了VC基础组件,需要增加一个用户环境变量,把"C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\bin" 添加到path变量中
|
||||
|
||||
#8、Install Ta-Lib
|
||||
如果你用py35虚拟环境
|
||||
source activate py35
|
||||
|
||||
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
|
||||
conda config --set show_channel_urls yes
|
||||
conda install -c quantopian ta-lib=0.4.9
|
||||
|
||||
# 9、数字货币的增量安装
|
||||
conda install scipy
|
||||
|
||||
pip install autobahn
|
||||
pip install twisted
|
||||
pip install pyOpenSSL
|
||||
|
||||
--------------------------------------------------------------------------------------------
|
||||
# vn.py - 基于python的开源交易平台开发框架
|
||||
https://github.com/vnpy/vnpy
|
||||
|
71
setup_ubuntu.md
Normal file
71
setup_ubuntu.md
Normal file
@ -0,0 +1,71 @@
|
||||
# 用户
|
||||
1、root,用于安装系统环境,如cmake,nodejs,boost等
|
||||
2、trade,用于安装anaconda,运行vnpy服务程序
|
||||
|
||||
# 安装
|
||||
1、[trade]下载 anaconda 3.6得64位安装包
|
||||
1) wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh
|
||||
2) sh Anaconda3-5.2.0-Linux-x86_64.sh
|
||||
安装过程,输入yes,同意安装目录 /home/trade/Anaconda3, 同意加入到trade这个用户得shell路径
|
||||
3) 退出当前trade用户,重新登录
|
||||
4) 更新一下 pip install --upgrade pip
|
||||
|
||||
2、 添加清华同方得源,到anaconda中. (如果服务器在海外,就免拉)
|
||||
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
|
||||
conda config --set show_channel_urls yes
|
||||
|
||||
3、创建python 3.5版本得环境。(为何不用3.6?我还没搞掂)
|
||||
conda create --name py35 python=3.5
|
||||
|
||||
激活py35
|
||||
source activate py35
|
||||
|
||||
4、更新ubuntu得开发环境
|
||||
使用root用户
|
||||
apt-get -y install gcc
|
||||
apt-get -y install make
|
||||
apt-get -y install libssl-dev
|
||||
apt-get -y install freetds-dev
|
||||
apt-get -y install python-dev
|
||||
apt-get -y install mpi-default-dev
|
||||
apt-get -y install libicu-dev
|
||||
apt-get -y install libbz2-dev
|
||||
apt-get -y install libboost-thread-dev
|
||||
apt-get -y install libboost-python-dev
|
||||
apt-get -y install cython
|
||||
apt-get -y install nodejs
|
||||
apt-get -y update
|
||||
apt-get -y install build-essential
|
||||
apt-get -y install unzip
|
||||
|
||||
5、boost得安装( 仅用于支持CTP的接口)
|
||||
wget http://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.gz/download
|
||||
改名 mv download boost_1_66_0.tar.gz
|
||||
解压 tar -xvzf boost_1_66_0.tar.gz
|
||||
cd boost_1_66_0/
|
||||
记得先创建好py35的虚拟环境
|
||||
export CPLUS_INCLUDE_PATH=/home/trade/anaconda3/envs/py35/include/python3.5m
|
||||
修改 boost_1_66_0/tools/build/example/user-config.jam :
|
||||
using python : 3.5 : /home/trade/anaconda3/envs/py35/bin/python3 : /home/trade/anaconda3/envs/py35/include/python3.5m : /home/trade/anaconda3/envs/py35/lib ;
|
||||
把user-config.jam复制到用户目录
|
||||
cp user-config.jam /root/
|
||||
回到 boost_1_66_0/
|
||||
运行bootstrap.sh
|
||||
./bootstrap.sh --with-python=/home/trade/anaconda3/envs/py35/bin/python3 --with-python-version=3.5 --with-python-root=/home/trade/anaconda3/envs/py35
|
||||
编译,安装
|
||||
./b2 --buildtype=complete install 时间大概十几分钟
|
||||
检查 /usr/local下,include/boost, lib/libboos_python3.so等是否存在
|
||||
|
||||
6、安装talib
|
||||
conda install -c quantopian ta-lib=0.4.9
|
||||
|
||||
7、下载vnpy
|
||||
wget -c https://github.com/msincenselee/vnpy/archive/master.zip
|
||||
unzip master.zip
|
||||
cd vnpy-master
|
||||
安装 所有前置数据包
|
||||
pip install -r requirements.txt
|
||||
安装pyqt
|
||||
conda install pyqt
|
||||
|
||||
pip uninstall websocket; pip uninstall websocket-client; pip install websocket-client.
|
Loading…
Reference in New Issue
Block a user