vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 200
声望: 46

启动时选择algo应用,遇到下面的错误(首次尝试运行algo应用)

Traceback (most recent call last):
  File "D:\ProgramFiles\VnStudio\lib\site-packages\vnstation\cli.py", line 90, in run_trader
    module = importlib.import_module(d["module"])
  File "D:\ProgramFiles\VnStudio\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "D:\ProgramFiles\VnStudio\lib\site-packages\vnpy\app\algo_trading\__init__.py", line 5, in <module>
    from .engine import AlgoEngine, APP_NAME
  File "D:\ProgramFiles\VnStudio\lib\site-packages\vnpy\app\algo_trading\engine.py", line 17, in <module>
    from .genus import GenusClient
  File "D:\ProgramFiles\VnStudio\lib\site-packages\vnpy\app\algo_trading\genus.py", line 6, in <module>
    import quickfix as fix
ModuleNotFoundError: No module named 'quickfix'

从错误提示看是缺少了quickfix模块,那就安装
于是进入VN Staudio Prompt窗口下输入:

pip install quickfix

安装quickfix模块,提示趋势Ms Visual C++ V14.0 build tools

那就先安装Ms Visual C++ V14.0 build tools,
搜索到Ms Visual C++ V14.0 build tools,
也装上了,
提示重新启动,
那就重新启动

再次安装quickfix

命令是:

pip install quickfix

出错啦:

D:\ProgramFiles\VnStudio>pip install quickfix
Collecting quickfix
  Using cached quickfix-1.15.1.tar.gz (1.5 MB)
Using legacy 'setup.py install' for quickfix, since package 'wheel' is not installed.
Installing collected packages: quickfix
    Running setup.py install for quickfix ... error
    ERROR: Command errored out with exit status 1:
     command: 'd:\programfiles\vnstudio\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hxxja\\AppData\\Local\\Temp\\pip-install-1sa6_klk\\quickfix\\setup.py'"'"'; __file__='"'"'C:\\Users\\hxxja\\AppData\\Local\\Temp\\pip-install-1sa6_klk\\quickfix\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\hxxja\AppData\Local\Temp\pip-record-qavjungc\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\programfiles\vnstudio\Include\quickfix'
         cwd: C:\Users\hxxja\AppData\Local\Temp\pip-install-1sa6_klk\quickfix\
    Complete output (38 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    copying quickfix.py -> build\lib.win-amd64-3.7
    copying quickfixt11.py -> build\lib.win-amd64-3.7
    copying quickfix40.py -> build\lib.win-amd64-3.7
    copying quickfix41.py -> build\lib.win-amd64-3.7
    copying quickfix42.py -> build\lib.win-amd64-3.7
    copying quickfix43.py -> build\lib.win-amd64-3.7
    copying quickfix44.py -> build\lib.win-amd64-3.7
    copying quickfix50.py -> build\lib.win-amd64-3.7
    copying quickfix50sp1.py -> build\lib.win-amd64-3.7
    copying quickfix50sp2.py -> build\lib.win-amd64-3.7
    running build_ext
    Testing for std::tr1::shared_ptr...
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON_MAJOR_VERSION=3 -IC++ -Id:\programfiles\vnstudio\include -Id:\programfiles\vnstudio\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tptest_std_tr1_shared_ptr.cpp /Fotest_std_tr1_shared_ptr.obj
    test_std_tr1_shared_ptr.cpp
    test_std_tr1_shared_ptr.cpp(1): fatal error C1083: Cannot open include file: 'tr1/memory': No such file or directory
     ...not found
    Testing for std::shared_ptr...
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe -std=c++0x /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON_MAJOR_VERSION=3 -IC++ -Id:\programfiles\vnstudio\include -Id:\programfiles\vnstudio\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tptest_std_shared_ptr.cpp /Fotest_std_shared_ptr.obj
    cl : Command line warning D9002 : ignoring unknown option '-std=c++0x'
    test_std_shared_ptr.cpp
    ...found
    Testing for std::unique_ptr...
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe -std=c++0x /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON_MAJOR_VERSION=3 -DHAVE_STD_SHARED_PTR -IC++ -Id:\programfiles\vnstudio\include -Id:\programfiles\vnstudio\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tptest_std_unique_ptr.cpp /Fotest_std_unique_ptr.obj
    cl : Command line warning D9002 : ignoring unknown option '-std=c++0x'
    test_std_unique_ptr.cpp
    ...found
    building '_quickfix' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\C++
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON_MAJOR_VERSION=3 -DHAVE_STD_SHARED_PTR -DHAVE_STD_UNIQUE_PTR -IC++ -Id:\programfiles\vnstudio\include -Id:\programfiles\vnstudio\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /TpC++\Acceptor.cpp /Fobuild\temp.win-amd64-3.7\Release\C++\Acceptor.obj -std=c++0x -Wno-deprecated -Wno-unused-variable -Wno-deprecated-declarations -Wno-maybe-uninitialized
    cl : Command line error D8021 : invalid numeric argument '/Wno-deprecated'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\programfiles\vnstudio\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hxxja\\AppData\\Local\\Temp\\pip-install-1sa6_klk\\quickfix\\setup.py'"'"'; __file__='"'"'C:\\Users\\hxxja\\AppData\\Local\\Temp\\pip-install-1sa6_klk\\quickfix\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\hxxja\AppData\Local\Temp\pip-record-qavjungc\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\programfiles\vnstudio\Include\quickfix' Check the logs for full command output.

被吓到了,不就是安装个algo需要的模块吗,出这么多错误!!!

缺啥给啥,要啥补啥,不待这样折磨人的!

那位大神遇到了这种问题,分享下解决问题的经验吧,先叩谢!!!

Member
avatar
加入于:
帖子: 2038
声望: 134

可参考https://www.vnpy.com/forum/topic/4250-geng-xin-dao-2-1-5wu-fa-da-kai-vn-trader-pro?page=1#pid14798

Member
avatar
加入于:
帖子: 200
声望: 46

xiaohe wrote:

可参考https://www.vnpy.com/forum/topic/4250-geng-xin-dao-2-1-5wu-fa-da-kai-vn-trader-pro?page=1#pid14798

谢谢您 !
还是管理员厉害 ! 这条命令好使:python -m pip install https://pip.vnpy.com/colletion/quickfix-1.15.1-cp37-cp37m-win_amd64.whl

Administrator
avatar
加入于:
帖子: 4607
声望: 264

我们为了装这玩意也搞了4、5天,他的pip安装需要C++版本的二进制链接库,还要放在指定目录,非常非常麻烦,最后才找了这个wheel包

Member
avatar
加入于:
帖子: 200
声望: 46

用Python的交易员 wrote:

我们为了装这玩意也搞了4、5天,他的pip安装需要C++版本的二进制链接库,还要放在指定目录,非常非常麻烦,最后才找了这个wheel包

安装您的wheel包确实快!!!

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

有没有mac下的wheel包

Administrator
avatar
加入于:
帖子: 4607
声望: 264

没,应该要自己装编译环境,从源代码编译下了

Member
加入于:
帖子: 77
声望: 0

centos系统怎么安装quickfix

Member
avatar
加入于:
帖子: 2038
声望: 134

应该要自己装编译环境,从源代码编译下了

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

沪公网安备 31011502017034号