zoukankan      html  css  js  c++  java
  • elasticsearch数据查询

    正在找可视化查询数据的工具,由于日常sql写的多,就再找有没有工具可以直接写sql就能查出来,果真有一款工具可以写sql opendistro-for-elasticsearch/,之前用浏览器插件ElasticSearch Head,发现不灵活以后,过段换成了这个。

    安装的时候遇到了问题,我的是mac pro,python3.8环境,运行提示:

    ❯ odfesql
    Traceback (most recent call last):
      File "/Users/lijshu/venv/bin/odfesql", line 5, in <module>
        from odfe_sql_cli.main import cli
      File "/Users/lijshu/venv/lib/python3.9/site-packages/odfe_sql_cli/main.py", line 21, in <module>
        from .esconnection import ESConnection
      File "/Users/lijshu/venv/lib/python3.9/site-packages/odfe_sql_cli/esconnection.py", line 22, in <module>
        from elasticsearch import Elasticsearch, RequestsHttpConnection
      File "/Users/lijshu/venv/lib/python3.9/site-packages/elasticsearch/__init__.py", line 24, in <module>
        from .client import Elasticsearch
      File "/Users/lijshu/venv/lib/python3.9/site-packages/elasticsearch/client/__init__.py", line 5, in <module>
        from ..transport import Transport
      File "/Users/lijshu/venv/lib/python3.9/site-packages/elasticsearch/transport.py", line 5, in <module>
        from .connection import Urllib3HttpConnection
      File "/Users/lijshu/venv/lib/python3.9/site-packages/elasticsearch/connection/__init__.py", line 2, in <module>
        from .http_requests import RequestsHttpConnection
      File "/Users/lijshu/venv/lib/python3.9/site-packages/elasticsearch/connection/http_requests.py", line 3, in <module>
        from base64 import decodestring
    ImportError: cannot import name 'decodestring' from 'base64' (/usr/local/Cellar/python@3.9/3.9.1_1/Frameworks
    

     解决办法:

    • upgrade elasticsearch-py dependency from 7.5.1 to 7.10.1
    • pip3 uninstall elasticsearch==7.5.1

    •  pip3 install elasticsearch

       

    备注:可能是我笔记本环境之前有一些别的包冲突导致,最后安装成功运行,能查询数据了。

    业余经济爱好者
  • 相关阅读:
    【转载】浮点数在内存中的存储格式
    流媒体完全手册
    Windows Mobile 5.0 SDK 下载地址
    实时传输协议 RTP
    JDK环境变量配置
    扩展Windows Mobile模拟器存储空间的方法
    WinSock学习笔记
    实时传输协议 RTCP
    NHibernate从入门到精通系列(4)——持久对象的生命周期(上)
    实时流协议 RTSP
  • 原文地址:https://www.cnblogs.com/5sdba-notes/p/14508212.html
Copyright © 2011-2022 走看看