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

问题解决

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/20464.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论