Python2连接hive--pyhive安装使用

刘承运
2023-12-01

1.sudo pip install pyhive[hive] 一定要后面的中括号
报错command ‘gcc’ failed with exit status 1
2.解决:sudo yum -y install libffi-devel;sudo yum install libgsasl-devel;sudo yum -y install libmemcached-devel;
3.from pyhive import hive
hive.Connection(ip,10000,database=‘default’)
报错thrift.transport.TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found
解决 sudo yum -y install cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi
报错 File “/usr/lib/python2.7/site-packages/thrift_sasl/init.py”, line 107, in _send_message body = six.ensure_binary(body)
AttributeError: ‘module’ object has no attribute ‘ensure_binary’
4.解决sudo pip install --upgrade six 由1.10.0升级到1.16.0
完成

 类似资料: