run vnpy in mac
欢迎转载,请支持原创,保留原文链接:blog.ilibrary.me
参考https://www.vnpy.com/docs/cn/ubuntu_install.html. 整个过程很suffer,最终放弃了。
conda create --name vnpy_python3.7 python=3.7
conda activate vnpy_python3.7
git clone https://github.com/vnpy/vnpy.git
cd vnpy
brew install ta-lib
./install_osx.sh
python run.py
- 抛错
Traceback (most recent call last): File "run.py", line 5, in <module> from vnpy.trader.ui import MainWindow, create_qapp File "/Users/i532140/sourcecode/vnpy/vnpy/trader/ui/__init__.py", line 1, in <module> from .qt import QtCore, QtWidgets, QtGui, Qt, create_qapp File "/Users/i532140/sourcecode/vnpy/vnpy/trader/ui/qt.py", line 9, in <module> from PySide6 import QtGui, QtWidgets, QtCore ImportError: could not import module 'PySide6.QtCore'
解决办法:
python examples/no_ui/run.py
, 抛错Traceback (most recent call last): File "examples/no_ui/run.py", line 11, in <module> from vnpy_ctp import CtpGateway ModuleNotFoundError: No module named 'vnpy_ctp'
解决办法:
- 注释掉
examples/no_ui/run.py
里面ctp和cta相关的代码. - 命令行可以起来,不知道怎么用.
- 注释掉
python examples/vn_trader/run.py
, 抛错:Traceback (most recent call last): File "examples/vn_trader/run.py", line 5, in <module> from vnpy.trader.ui import MainWindow, create_qapp File "/Users/i532140/opt/anaconda3/envs/vnpy_python3.7/lib/python3.7/site-packages/vnpy/trader/ui/__init__.py", line 1, in <module> from .qt import QtCore, QtWidgets, QtGui, Qt, create_qapp File "/Users/i532140/opt/anaconda3/envs/vnpy_python3.7/lib/python3.7/site-packages/vnpy/trader/ui/qt.py", line 9, in <module> from PySide6 import QtGui, QtWidgets, QtCore ImportError: could not import module 'PySide6.QtCore'
10.