[试图从我的PC用python连接到hive(hue)时,SASL错误-Windows10

问题描述 投票:0回答:1

需要您的帮助!我阅读了我在互联网上找到的所有文档(StackOverflow,Github等),但没有任何帮助。我试图通过python从PC连接到hive(hue),我的脚本是:

enter image description here

当我运行此代码时,我收到此错误消息:

 Traceback (most recent call last):
 File "C:/Users/myuser/Documents/Python/testing.py", line 6, in <module>
 cursor = hive.connect('myconnect', port=10000, username='root').cursor()
 File "C:\Users\myuser\AppData\Local\Continuum\anaconda3\lib\site-packages\pyhive\hive.py", line 94, 
 in connect
 return Connection(*args, **kwargs)
 File "C:\Users\myuser\AppData\Local\Continuum\anaconda3\lib\site-packages\pyhive\hive.py", line 
 192, in __init__self._transport.open()File 
 "C:\Users\myuser\AppData\Local\Continuum\anaconda3\lib\site-packages\thrift_sasl\__init__.py", line 
 79, in open message=("Could not start SASL: %s" % self.sasl.getError()))
 thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start 
 (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'

我的系统详细信息:OS:Windows 10专业版Python版本:Python 3.7.4分发:Anaconda,Inc.在win32上

python windows-10 hue sasl pyhive
1个回答
0
投票

我找到了解决此问题的方法。已采取的措施:

  1. 在我的PC上安装了VirtualBox和Ubuntu OS。
  2. 以根用户身份运行Ubuntu。
  3. 已安装的python,pip3和相关库(pyhive,sasl,thrift_sasl和thrift)
  4. 运行我的代码-效果很好

我的结论是我的问题是由于安全(我不是工作站的管理员)和Windows问题引起的。

© www.soinside.com 2019 - 2024. All rights reserved.