zoukankan      html  css  js  c++  java
  • 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:Python37libsite-packages ushare\__init__.py", line 82, in <module>
    from tushare.pro.data_pro import (pro_api, pro_bar, subs)
    File "D:Python37libsite-packages ushareprodata_pro.py", line 14, in <module>
    from tushare.subs import Subs
    File "D:Python37libsite-packages usharesubs\__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

    问题解决

  • 相关阅读:
    Python自动化运维答疑解惑
    MySQL基础
    Centos下常用MySQL语法
    PDO
    生成静态页面的好处
    页面纯静态
    源码安装LNMP
    Nginx URL重写(rewrite)
    防盗链
    自定义菜单
  • 原文地址:https://www.cnblogs.com/baby123/p/13844651.html
Copyright © 2011-2022 走看看