1. 首先确认安装的brew版本
    执行 uname -m, 如果是arm版本则继续,否则需要卸载重新安装;
  2. 安装conda-forge, 确保当前conda环境唯一
  3. 创建python环境:

    conda create -n vnpy python=3.9
    conda activate vnpy
  4. 确保python版本为arm
    执行 file $(which python3) 确保出现:

    Mach-O 64-bit executable arm64
  5. 安装ta_lib,执行:

    brew install ta-lib
    conda install -c conda-forge ta-lib -y
    pip install importlib_metadata
    pip install vnpy_ctastrategy
    pip install vnpy_ctabacktester
    pip install vnpy_spreadtrading
    pip install vnpy_algotrading
    pip install vnpy_optionmaster
    pip install vnpy_datarecorder
    pip install vnpy_riskmanager
    pip install vnpy_webtrader
    pip install vnpy_portfoliomanager
    pip install vnpy_paperaccount
    pip install vnpy_sqlite
    pip install vnpy_rqdata
    ## 运行时出现 AttributeError: 'PySide6.QtWidgets.QDockWidget' object has no attribute 'DockWidgetFloatable'
    pip install  PySide6==6.3.0
  6. 启动界面
    gitclone https://github.com/vnpy/vnpy.git
    执行:
    python3 examples/veighna_trader/run.py

要点
确定brew与python 都是arm64架构,一般错误都是由于版本不一致导致;


jacky chen
0 声望0 粉丝