VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 12
声望: 0

请教,在CTPTEST 成功链接后,每次3秒后就会自动闪退。是什么问题?日志如下:

2023-06-16 14:30:10 --------------------------------------------------
2023-06-16 14:30:10 VeighNa Trader进程启动
2023-06-16 14:30:16 2023-06-16 14:30:16,349 INFO: 交易服务器连接成功
2023-06-16 14:30:16 2023-06-16 14:30:16,359 INFO: 行情服务器连接成功
2023-06-16 14:30:16 2023-06-16 14:30:16,415 INFO: 行情服务器登录成功
2023-06-16 14:30:16 2023-06-16 14:30:16,649 INFO: 交易服务器授权验证成功
2023-06-16 14:30:16 2023-06-16 14:30:16,680 INFO: 交易服务器登录成功
2023-06-16 14:30:19 VeighNa Trader进程终止

Member
avatar
加入于:
帖子: 1481
声望: 105

直接替换dll后导致的吧,vnpy_ctp.api需要做重新编译

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

MTF wrote:

直接替换dll后导致的吧,vnpy_ctp.api需要做重新编译
期货公司给的dll 和 lib,自己需要重新编译吗?

Member
avatar
加入于:
帖子: 4729
声望: 287

你用的vnpy_ctptest版本是?期货公司给的评测api的版本是?

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

xiaohe wrote:

你用的vnpy_ctptest版本是?期货公司给的评测api的版本是?

vnpy_ctptest版本是(测试6.6.7),期货公司给的评测api的版本是 6.3.15_20190220_tradeapi64_se_windows

Member
avatar
加入于:
帖子: 4729
声望: 287

6.6.7以下的版本,可以pip install vnpy_ctptest==6.5.1.5然后用期货公司发的包里的dll替换api文件夹下同名dll试试看

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

请问这个报错该如何解决?

PS C:\Windows\system32> pip install vnpy_ctptest==6.5.1.5
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting vnpy_ctptest==6.5.1.5
Using cached https://mirrors.aliyun.com/pypi/packages/b8/98/aef6385be9d433871c69b77586c47c77a70e9af5b2f7bedf9d9e5181fac9/vnpy_ctptest-6.5.1.5.ta
r.gz (6.3 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting importlib_metadata (from vnpy_ctptest==6.5.1.5)
Downloading https://mirrors.aliyun.com/pypi/packages/ff/94/64287b38c7de4c90683630338cf28f129decbba0a44f0c6db35a873c73c4/importlib_metadata-6.7.0
-py3-none-any.whl (22 kB)
Requirement already satisfied: zipp>=0.5 in c:\python38-32\lib\site-packages (from importlib_metadata->vnpy_ctptest==6.5.1.5) (3.15.0)
Building wheels for collected packages: vnpy_ctptest
Building wheel for vnpy_ctptest (setup.py): started
Building wheel for vnpy_ctptest (setup.py): finished with status 'error'
pip : error: subprocess-exited-with-error
所在位置 行:1 字符: 1

  • pip install vnpy_ctptest==6.5.1.5
  • ~~~~~~~~~
    • CategoryInfo : NotSpecified: ( error: subprocess-exited-with-error:String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError

python setup.py bdist_wheel did not run successfully.
exit code: 1

[119 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\vnpy_ctptest
copying vnpy_ctptest__init.py -> build\lib.win32-3.8\vnpy_ctptest
creating build\lib.win32-3.8\vnpy_ctptest\api
copying vnpy_ctptest\api\ctp_constant.py -> build\lib.win32-3.8\vnpy_ctptest\api
copying vnpy_ctptest\api\
init.py -> build\lib.win32-3.8\vnpy_ctptest\api
creating build\lib.win32-3.8\vnpy_ctptest\gateway
copying vnpy_ctptest\gateway\ctptest_gateway.py -> build\lib.win32-3.8\vnpy_ctptest\gateway
copying vnpy_ctptest\gateway\
init.py -> build\lib.win32-3.8\vnpy_ctptest\gateway
running egg_info
writing vnpy_ctptest.egg-info\PKG-INFO
writing dependency_links to vnpy_ctptest.egg-info\dependency_links.txt
writing requirements to vnpy_ctptest.egg-info\requires.txt
writing top-level names to vnpy_ctptest.egg-info\top_level.txt
reading manifest file 'vnpy_ctptest.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.pyd' under directory 'vnpy_ctptest'
writing manifest file 'vnpy_ctptest.egg-info\SOURCES.txt'
creating build\lib.win32-3.8\vnpy_ctptest\api\vnctp
creating build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
copying vnpy_ctptest\api\vnctp\vnctpmd\vnctpmd.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
creating build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
copying vnpy_ctptest\api\vnctp\vnctptd\vnctptd.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
copying vnpy_ctptest\api\libthostmduserapi_se.so -> build\lib.win32-3.8\vnpy_ctptest\api
copying vnpy_ctptest\api\libthosttraderapi_se.so -> build\lib.win32-3.8\vnpy_ctptest\api
copying vnpy_ctptest\api\thostmduserapi_se.dll -> build\lib.win32-3.8\vnpy_ctptest\api
copying vnpy_ctptest\api\thosttraderapi_se.dll -> build\lib.win32-3.8\vnpy_ctptest\api
creating build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_header_define.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_header_function.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_header_on.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_header_process.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_source_function.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_source_module.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_source_on.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_source_process.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_source_switch.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_md_source_task.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_header_define.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_header_function.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_header_on.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_header_process.h -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_source_function.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_source_module.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_source_on.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_source_process.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_source_switch.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
copying vnpy_ctptest\api\generator\ctp_td_source_task.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\generator
creating build\lib.win32-3.8\vnpy_ctptest\api\include
creating build\lib.win32-3.8\vnpy_ctptest\api\include\ctp
copying vnpy_ctptest\api\include\ctp\ThostFtdcMdApi.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\ctp
copying vnpy_ctptest\api\include\ctp\ThostFtdcTraderApi.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\ctp
copying vnpy_ctptest\api\include\ctp\ThostFtdcUserApiDataType.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\ctp
copying vnpy_ctptest\api\include\ctp\ThostFtdcUserApiStruct.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\ctp
creating build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\attr.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\buffer_info.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\cast.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\chrono.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\common.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\complex.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\eigen.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\embed.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\eval.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\functional.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\iostream.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\numpy.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\operators.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\options.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\pybind11.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\pytypes.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\stl.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
copying vnpy_ctptest\api\include\pybind11\stl_bind.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11
creating build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
copying vnpy_ctptest\api\include\pybind11\detail\class.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
copying vnpy_ctptest\api\include\pybind11\detail\common.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
copying vnpy_ctptest\api\include\pybind11\detail\descr.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
copying vnpy_ctptest\api\include\pybind11\detail\init.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
copying vnpy_ctptest\api\include\pybind11\detail\internals.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
copying vnpy_ctptest\api\include\pybind11\detail\typeid.h -> build\lib.win32-3.8\vnpy_ctptest\api\include\pybind11\detail
creating build\lib.win32-3.8\vnpy_ctptest\api\libs
copying vnpy_ctptest\api\libs\thostmduserapi_se.lib -> build\lib.win32-3.8\vnpy_ctptest\api\libs
copying vnpy_ctptest\api\libs\thosttraderapi_se.lib -> build\lib.win32-3.8\vnpy_ctptest\api\libs
copying vnpy_ctptest\api\vnctp\vnctp.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp
copying vnpy_ctptest\api\vnctp\vnctpmd\dllmain.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
copying vnpy_ctptest\api\vnctp\vnctpmd\stdafx.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
copying vnpy_ctptest\api\vnctp\vnctpmd\stdafx.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
copying vnpy_ctptest\api\vnctp\vnctpmd\targetver.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
copying vnpy_ctptest\api\vnctp\vnctpmd\vnctpmd.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctpmd
copying vnpy_ctptest\api\vnctp\vnctptd\dllmain.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
copying vnpy_ctptest\api\vnctp\vnctptd\stdafx.cpp -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
copying vnpy_ctptest\api\vnctp\vnctptd\stdafx.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
copying vnpy_ctptest\api\vnctp\vnctptd\targetver.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
copying vnpy_ctptest\api\vnctp\vnctptd\vnctptd.h -> build\lib.win32-3.8\vnpy_ctptest\api\vnctp\vnctptd
running build_ext
building 'vnpy_ctptest.api.vnctptd' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\vnpy_ctptest
creating build\temp.win32-3.8\Release\vnpy_ctptest\api
creating build\temp.win32-3.8\Release\vnpy_ctptest\api\vnctp
creating build\temp.win32-3.8\Release\vnpy_ctptest\api\vnctp\vnctptd
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I
vnpy_ctptest/api/include -Ivnpy_ctptest/api/vnctp -Ic:\python38-32\include -Ic:\python38-32\include "-ID:\Program Files\Microsoft Visual Studio\2
022\Community\VC\Tools\MSVC\14.35.32215\include" "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-ID:\Window
s Kits\10\include\10.0.22621.0\ucrt" "-ID:\Windows Kits\10\include\10.0.22621.0\um" "-ID:\Windows Kits\10\include\10.0.22621.0\shared" "-ID:\
Windows Kits\10\include\10.0.22621.0\winrt" "-ID:\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFX
SDK\4.8\include\um" /EHsc /Tpvnpy_ctptest/api/vnctp/vnctptd/vnctptd.cpp /Fobuild\temp.win32-3.8\Release\vnpy_ctptest/api/vnctp/vnctptd/vnctptd.ob
j -O2 -MT
cl: 命令行 warning D9025 :正在重写“/MD”(用“/MT”)
vnctptd.cpp
C:\Users\许鑫\AppData\Local\Temp\pip-install-nl1207wq\vnpy-ctptest_b579fc09a78245a18d72d4dc3c1bbff8\vnpy_ctptest\api\include\ctp\ThostFtdcUserApi
Struct.h(7950): warning $819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\Users\许鑫\AppData\Local\Temp\pip-install-nl1207wq\vnpy-ctptest_b579fc09a78245a18d72d4dc3c1bbff8\vnpy_ctptest\api\include\ctp\ThostFtdcUserApi
Struct.h(9060): warning $819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
vnpy_ctptest/api/vnctp/vnctptd/vnctptd.cpp(11526): warning $996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s in
stead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
Running setup.py clean for vnpy_ctptest
vnpy_ctptest/api/vnctp\vnctp.h(117): warning $996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disa
ble deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
vnpy_ctptest/api/vnctp/vnctptd/vnctptd.cpp(8570): note: 查看对正在编译的函数 模板 实例化“void getString<11>(const pybind11::dict &,const char
,char (&)[11])”
的引用
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /
MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:vnpy_ctptest/api/libs /LIBPATH:vnpy_ctptest/api /LIBPATH:c:\python38-32\libs /LIBPATH:c:\python38-32
\PCbuild\win32 "/LIBPATH:D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\lib\x86" "/LIBPATH:C:\Program Files (x
86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:D:\Windows Kits\10\lib\10.0.22621.0\ucrt\x86" "/LIBPATH:D:\Windows Kits\10\lib\10.0.22621.0\
\um\x86" thostmduserapi_se.lib thosttraderapi_se.lib /EXPORT:PyInit_vnctptd build\temp.win32-3.8\Release\vnpy_ctptest/api/vnctp/vnctptd/vnctptd.o
bj /OUT:build\lib.win32-3.8\vnpy_ctptest\api\vnctptd.cp38-win32.pyd /IMPLIB:build\temp.win32-3.8\Release\vnpy_ctptest/api/vnctp/vnctptd\vnctptd.c
p38-win32.lib
正在创建库 build\temp.win32-3.8\Release\vnpy_ctptest/api/vnctp/vnctptd\vnctptd.cp38-win32.lib 和对象 build\temp.win32-3.8\Release\vnpy_ctptest/api/vn
ctp/vnctptd\vnctptd.cp38-win32.exp
vnctptd.obj : error LNK2001: 无法解析的外部符号 "public: static class CThostFtdcTraderApi *
cdecl CThostFtdcTraderApi::CreateFtdcTraderApi(char const
*)" (?CreateFtdcTraderApi@CThostFtdcTraderApi@@SAP$1@PBD@Z)
build\lib.win32-3.8\vnpy_ctptest\api\vnctptd.cp38-win32.pyd : fatal error LNK1120: 1 个无法解析的外部命令
error: command 'D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x86\link.exe' failed
with exit status 1120
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for vnpy_ctptest
Failed to build vnpy_ctptest
ERROR: Could not build wheels for vnpy_ctptest, which is required to install pyproject.toml-based projects

Member
avatar
加入于:
帖子: 4729
声望: 287

veighna没有提供32位支持

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

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】