vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 4
声望: 0

本人在Ubuntu 18.04 x64操作系统上将vnpy更新到2.10版本,所需的依赖已全部安装,cython是通过源码编译安装的,并且确认工作正常。vnpy升级过程中没有任何问题,在启动时,terminal有“Faile to import cython option pricing model, please rebuild with cython in cmd.”的报错。程序能正常启动运行,请教各位大神:该报错是什么问题导致的?该如何解决?万分感谢~

Administrator
avatar
加入于:
帖子: 5091
声望: 294

cython定价模型需要自己下载vn.py源代码,对vnpy/app/option_master/pricing下的cython代码重新编译即可

Member
avatar
加入于:
帖子: 4
声望: 0

用Python的交易员 wrote:

cython定价模型需要自己下载vn.py源代码,对vnpy/app/option_master/pricing下的cython代码重新编译即可

已解决,感谢~

Member
avatar
加入于:
帖子: 5
声望: 0

用Python的交易员 wrote:

cython定价模型需要自己下载vn.py源代码,对vnpy/app/option_master/pricing下的cython代码重新编译即可
怎么编译的

Member
avatar
加入于:
帖子: 3124
声望: 182

可参考https://www.vnpy.com/forum/topic/6186-faile-to-import-cython-option-pricing-model-please-rebuild-with-cython-in-cmd?page=1#pid21947

Member
avatar
加入于:
帖子: 5
声望: 0

xiaohe wrote:

可参考https://www.vnpy.com/forum/topic/6186-faile-to-import-cython-option-pricing-model-please-rebuild-with-cython-in-cmd?page=1#pid21947
building 'binomial_tree_cython' extension
creating build/temp.macosx-10.9-x86_64-3.7
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/baishaojie/.conda/envs/vnpy-master/include -arch x86_64 -I/Users/baishaojie/.conda/envs/vnpy-master/include -arch x86_64 -I/Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include -I/Users/baishaojie/.conda/envs/vnpy-master/include/python3.7m -c binomial_tree_cython.c -o build/temp.macosx-10.9-x86_64-3.7/binomial_tree_cython.o
In file included from binomial_tree_cython.c:633:
In file included from /Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969:
/Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it with " \

我在 vnpy/app/option_master/pricing/cython_model/binomial_tree_cython 目录下运行了 python setup.py build_ext --inplace 出现的警告,控制台还是有Faile to import cython option pricing model, please rebuild with cython in cmd. 的警告是为什么呢大佬?

Member
avatar
加入于:
帖子: 5
声望: 0

xiaohe wrote:

可参考https://www.vnpy.com/forum/topic/6186-faile-to-import-cython-option-pricing-model-please-rebuild-with-cython-in-cmd?page=1#pid21947
我重新在那三个目录下运行了 python setup.py build_ext --inplace 显示running 中,但是我重新调试启动面板还是出现 terminal有“Faile to import cython option pricing model, please rebuild with cython in cmd.”的报错

(vnpy-master) baishaojie@macdeiMac-Pro binomial_tree_cython % python setup.py build_ext --inplace
running build_ext
Administrator
avatar
加入于:
帖子: 5091
声望: 294

宇纳 wrote:

xiaohe wrote:

可参考https://www.vnpy.com/forum/topic/6186-faile-to-import-cython-option-pricing-model-please-rebuild-with-cython-in-cmd?page=1#pid21947
building 'binomial_tree_cython' extension
creating build/temp.macosx-10.9-x86_64-3.7
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/baishaojie/.conda/envs/vnpy-master/include -arch x86_64 -I/Users/baishaojie/.conda/envs/vnpy-master/include -arch x86_64 -I/Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include -I/Users/baishaojie/.conda/envs/vnpy-master/include/python3.7m -c binomial_tree_cython.c -o build/temp.macosx-10.9-x86_64-3.7/binomial_tree_cython.o
In file included from binomial_tree_cython.c:633:
In file included from /Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969:
/Users/baishaojie/.conda/envs/vnpy-master/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it with " \

我在 vnpy/app/option_master/pricing/cython_model/binomial_tree_cython 目录下运行了 python setup.py build_ext --inplace 出现的警告,控制台还是有Faile to import cython option pricing model, please rebuild with cython in cmd. 的警告是为什么呢大佬?

这个是Warning提醒信息,如果是编译失败应该会有Error报错,请找到后贴下

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号