module ‘websocket’ has no attribute ‘enableTrace’ 怎样处置

module ‘websocket’ has no attribute ‘enableTrace’ 怎样处置

websocket.enableTrace(False)

wsUrl = wsParam.create_url()

ws = websocket.WebSocketApp(wsUrl, on_message=on_message, on_error=on_error, on_close=on_close)

报错:

Traceback (most recent call last):

File "c:/Users/wave4/Downloads/tts_ws_python3_demo/tts_ws_python3_demo/tts_ws_python3_demo.py", line 143, in

websocket.enableTrace(False)

AttributeError: module 'websocket' has no attribute 'enableTrace'

因为:缺乏websocket-client库

处置计划安置websocket-client:

pip install websocket-client

分享到 :

Leave a Reply

Your email address will not be published. Required fields are marked *