1、安装miniconda
打开 https://docs.conda.io/en/latest/miniconda.html 下载miniconda并安装
2、配置pip本地源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
3、创建conda虚拟环境
conda create -n vnpy3 python=3.10
conda activate vnpy3
4、安装TA-lib
打开https://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载TA_Lib‑0.4.24‑cp310‑cp310‑win_amd64.whl
pip install TA_Lib‑0.4.24‑cp310‑cp310‑win_amd64.whl
5、安装VeighNa本身
pip install vnpy vnpy_ctastrategy vnpy_ctabacktester vnpy_spreadtrading vnpy_optionmaster vnpy_portfoliostrategy vnpy_algotrading vnpy_scripttrader vnpy_paperaccount vnpy_chartwizard vnpy_portfoliomanager vnpy_rpcservice vnpy_datamanager vnpy_datarecorder vnpy_excelrtd vnpy_riskmanager vnpy_webtrader vnpy_rest vnpy_websocket vnpy_sqlite vnpy_mysql vnpy_tushare vnpy_ctp vnpy_rqdata
6、下载代码
https://gitee.com/vnpy/vnpy/releases 下载最新稳定版,解压到目录C:\vnpy
cd C:\vnpy\
install.bat
pip install --upgrade numpy
cd C:\vnpy\examples\veighna_trader
python run.py
7、出现错误“Could not load the Qt platform plugin "windows"”
C:\ProgramData\Miniconda3\envs\vnpy3\Lib\site-packages\PySide6\plugins\platforms
替换掉
C:\ProgramData\Miniconda3\envs\vnpy3\Library\plugins\platforms