请帮我找出问题所在。这是可执行代码:
import pandas as pd
import sqlalchemy
from binance.client import Client
from binance import BinanceSocketManager
import asyncio
client = Client(api_key, api_secret)
async def main():
bsm = BinanceSocketManager(client)
socket = bsm.trade_socket('BTCUSDT')
await socket.__aenter__()
msg = await socket.recv()
return print(msg)
loop = asyncio.get_event_loop()
forecast = loop.run_until_complete(main())
loop.close()
错误:任务已销毁,但它正在等待处理!任务:<Task pending name='Task-9' coro=<WebSocketCommonProtocol.recv() 完成,定义在 /Users/v/Downloads/soft/anaconda3/lib/python3.9/site-packages/websockets/legacy/protocol .py:486> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fd45d952a90>()]> cb=[_release_waiter(()]>)() at /Users/v/Downloads/soft/anaconda3/lib/python3 .9/asyncio/tasks.py:416]>