环境
python 3.5
win 7
一、按照以下顺序安装所需的包及版本:
pip install pure-sasl
pip install thrift_sasl==0.2.1 --no-deps
pip install thrift==0.9.3
pip install impyla
pip install thriftpy这里是引用
二、安装完成之后 测试连接:
------------------------------python 连接impala代码---------------------------------
from impala.dbapi import connect
if __name__ == '__main__':
conn = connect(host='x.x.x.x', port=10000, database='dw', auth_mechanism='PLAIN',user='guest', password='guest')
cur = conn.cursor()
cur.execute("select * from dt.x_x_x limit 10")
print(cur.fetchall())
报如下错误
TypeError: can't concat str to bytes
------------------------------ 报如下错误----------------------