手动安装,脚本启动,如果加载此行代码 from vnpy_optionmaster import OptionMasterApp 会出现以下提示:
(vn.py) PS D:\CodeComputerLanguage\GitCode\vnpy-master> python run.py
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.5 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "D:\CodeComputerLanguage\GitCode\vnpy-master\run.py", line 31, in <module>
from vnpy_optionmaster import OptionMasterApp # 期权波动率交易模块
File "D:\CodeComputerLanguage\CodeApp\miniconda3\envs\vn.py\lib\site-packages\vnpy_optionmaster__init__.py", line 26, in <module>
from .engine import OptionEngine, APP_NAME
File "D:\CodeComputerLanguage\CodeApp\miniconda3\envs\vn.py\lib\site-packages\vnpy_optionmaster\engine.py", line 35, in <module>
from .pricing import binomial_tree_cython as binomial_tree
Faile to import cython option pricing model, please rebuild with cython in cmd.
将numpy降级到1.26.4 后解决。
但降级后pip警告:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
vnpy 4.1.0 requires numpy>=2.2.3, but you have numpy 1.26.4 which is incompatible.
希望版主下次升级 vnpy 版本时可以解决这个问题。