一、准备Ubuntu
建议使用一个新安装干净的Ubuntu环境(如果你一定要使用老环境也行,万一不幸掉坑后再回到这步就好),我这里使用的环境如下:
· 版本:Ubuntu 16.04/14.04 LTS
· 语言:简体中文
· 时区:Shanghai
二、安装Anaconda
在Continuum官网下载Python 2.7版本Linux 64-Bit的Anaconda,我这里下载完成后的文件名为Anaconda2-4.0.0-Linux-x86_64.sh。
打开Terminal(终端),进入文件所在的目录,输入如下命令:
bash Anaconda2-4.0.0-Linux-x86_64.sh
三、安装其他依赖
使用pip安装MongoDB驱动和Qt黑色主题,注意不要加sudo:
pip install pymongo qdarkstyle
使用apt-get安装编译API相关的工具:
sudo apt-get install git build-essential libboost-all-dev python-dev cmake
四、安装ta-lib
conda install -c https://conda.anaconda.org/quantopian ta-lib
五、安装PyQt4
由于PyQt工具包比普通的Python扩展类库要复杂得多,所以不能直接pip install PyQt4或者easy_install PyQt4,需要上官网去下专门的安装包。下载地址:
https://riverbankcomputing.com/software/pyqt/download
python configure.py
Make -j4
Make install
六、下载vnpy1.5版
http://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-1.5.zip
python vtMain.py