diff --git a/README.md b/README.md index 68100a69..85cb7be9 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,12 @@ vn.py是基于Python的开源量化交易程序开发框架,起源于国内私 **Windows** +推荐使用Windows环境一键安装脚本init.bat,打开cmd后运行即可自动完成以下环境和vn.py框架的下载安装工作。若由于网络不稳定的原因,导致某些步骤安装耗时过长而失败,可以配置好VPN后,手动在cmd中执行失败的命令继续完成安装。 + 1. 支持的操作系统:Windows 7/8/10/Server 2008 2. 安装[MongoDB](https://www.mongodb.org/downloads#production),并[将MongoDB配置为系统服务](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#configure-a-windows-service-for-mongodb-community-edition) 3. 安装[Anaconda](http://www.continuum.io/downloads),**注意必须是Python 2.7 32位版本** 4. 安装[Visual C++ Redistributable Packages for VS2013 x86版本](https://support.microsoft.com/en-us/help/3138367/update-for-visual-c-2013-and-visual-c-redistributable-package) -5. 安装[python-snappy](https://www.lfd.uci.edu/~gohlke/pythonlibs/),使用命令**pip install python_snappy-0.5.1-cp27-cp27m-win32.whl** **Ubuntu** @@ -95,21 +96,11 @@ vn.py是基于Python的开源量化交易程序开发框架,起源于国内私 --- ### 项目安装 -**方法1** - 在[这里](https://github.com/vnpy/vnpy/releases)下载最新版本,解压后: * Windows:双击运行install.bat自动安装 * Ubuntu:在Terminal中运行bash install.sh自动安装 -**方法2** - -``` -pip install vnpy pymongo msgpack-python websocket-client qdarkstyle - -conda install -c quantopian ta-lib=0.4.9 -``` - **关于TA-Lib安装** Ubuntu上安装到talib时若遭遇'Permission denied'错误,请在install.sh运行完成后,在Terminal中输入以下命令安装: diff --git a/init.bat b/init.bat new file mode 100644 index 00000000..f244dd63 --- /dev/null +++ b/init.bat @@ -0,0 +1,33 @@ +::װChocolate +@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + +::װAnaconda +choco install anaconda2 --version 4.0.0 --x86 -y --ignorechecksum --params="'/AddToPath=1'" +setx PATH "%PATH%;C:\Program Files\Anaconda2\;C:\Program Files\Anaconda2\Scripts\" + +::װVC Redist +choco install vcredist2013 --x86 -y + +::װMongoDB +choco install mongodb -y + +::װGit +choco install git -y + +::vn.py +call refreshenv +cd c:\ +git clone "https://github.com/vnpy/vnpy.git" + +::עMongoDBΪϵͳ +cd vnpy +git checkout dev + +mkdir c:\data\db +mkdir c:\data\log + +"C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe" --config "C:\vnpy\mongod.cfg" --install +net start MongoDB + +::װvn.py +start /wait install.bat