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