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

使用tushare,test.py

import tushare

print(tushare.__version__)

报错

Traceback (most recent call last):
File "test.py", line 1, in <module>
import tushare
File "D:\Python37\lib\site-packages\tushare\__init__.py", line 82, in <module>
from tushare.pro.data_pro import (pro_api, pro_bar, subs)
File "D:\Python37\lib\site-packages\tushare\pro\data_pro.py", line 14, in <module>
from tushare.subs import Subs
File "D:\Python37\lib\site-packages\tushare\subs\__init__.py", line 18, in <module>
websocket.enableTrace(False)
AttributeError: module ‘websocket‘ has no attribute ‘enableTrace‘

安装websocket-client

pip install websocket-client

提示已经安装了,但是还报错,先将以前的移除

pip uninstall websocket-client

再安装websocket-client后

>python test.py
1.2.60

问题解决

 

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

上一篇:BurpSuite+Proxifer 抓取PC客户端HTTP数据包


下一篇:PostgreSQL数据库事务系统Upper Layer——BeginImplicitTransactionBlock