python - 错误 - b'sasl_client_start (-4) SASL(-4) 中的错误:没有可用的机制:无法找到回调:2'
问题描述
我正在尝试通过 Python(Jupyter Notebooks)连接到 HIVE。我已经安装了使用 Python 连接 HIVE 所需的所有软件包 -
sasl 0.2.1 py37h8a4fda4_1
thrift 0.13.0 pypi_0 pypi
thrift-sasl 0.3.0 pypi_0 pypi
pyhive 0.6.1 pypi_0 pypi
from pyhive import hive
conn = hive.Connection(host="xxxxxxx", port=xxxxx, username="xxxxxxxx")
但无法连接,因为它抛出错误:TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'
.
我错过了什么吗?如何连接?
解决方案
在 Windows 平台上,您需要将 C:\PyProj\MyProj\venv\Lib\site-packages\sasl\sasl2 目录的路径添加到 win reestr。在win命令行中:C:\Windows\system32>REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Carnegie Mellon\Project Cyrus\SASL Library" /v SearchPath /t REG_SZ /d "C:\PyProj\MyProj\venv\Lib\site -包\sasl\sasl2"
推荐阅读
- java - Google 在 Appcompactivity - Android 中对 AutoCompleteTextView 进行 api 调用
- mongodb - 使用 $pull 从用户模型中拉出对象,遇到多个对象项的问题
- angular - 如何以角度合并/合并数组内的数组
- prometheus - Prometheus 基于一天中的时间查询
- mysql - 查询特定科目通过或未通过的学生
- excel - 将 mdb 到 accdb 转换为 excel vba
- python - 如何在 appengine 标准中设置全局标志
- google-cloud-firestore - 从 Firestore 获取多个数据
- java - 如何集成空手道和黄瓜并从单个文件/类调用两者
- javascript - Vue JS 标签不会从 JSON 呈现为 HTML