FutunnOpen / py-futu-api

富途 OpenAPI Python SDK
Apache License 2.0
1.04k stars 221 forks source link

Python 3.6.7 Demo无法运行 #23

Closed liheyuan closed 4 years ago

liheyuan commented 5 years ago

Traceback (most recent call last): File "./hk_ipo_history_price.py", line 1, in import futu as ft File "/usr/local/lib/python3.6/dist-packages/futu/init.py", line 22, in from futu.quote.open_quote_context import OpenQuoteContext File "/usr/local/lib/python3.6/dist-packages/futu/quote/open_quote_context.py", line 11, in from futu.common.open_context_base import OpenContextBase, ContextStatus File "/usr/local/lib/python3.6/dist-packages/futu/common/open_context_base.py", line 11, in from futu.common.utils import File "/usr/local/lib/python3.6/dist-packages/futu/common/utils.py", line 8, in from futu.common.conn_mng import File "/usr/local/lib/python3.6/dist-packages/futu/common/conn_mng.py", line 5, in from futu.common.constant import * File "/usr/local/lib/python3.6/dist-packages/futu/common/constant.py", line 140, in from futu.common.pb import Trd_Common_pb2 File "/usr/local/lib/python3.6/dist-packages/futu/common/pb/Trd_Common_pb2.py", line 17, in import Common_pb2 as Common__pb2 File "/usr/local/lib/python3.6/dist-packages/futu/common/pb/Common_pb2.py", line 107, in options=None, file=DESCRIPTOR), TypeError: new() got an unexpected keyword argument 'file'

示例代码

import futu as ft

quote_ctx = ft.OpenQuoteContext(host='127.0.0.1', port=11111) print(quote_ctx.get_market_snapshot('HK.00700')) quote_ctx.close()

liuslevis commented 5 years ago

Did you launch FutuOpenD? https://futunnopen.github.io/futu-api-doc/intro/FutuOpenDGuide.html

liheyuan commented 5 years ago

Sure, FutuOpenD is in background. Python 2.7.x works. But Python 3.x fails.

FutunnOpen commented 4 years ago

你好,可加qq群108534288联系管理员解决。