开发者社区> 问答> 正文

python执行cursor = conn.cursor()报错 ?报错

在执行cursor = conn.cursor()报错
图片说明

Traceback (most recent call last):
File "mid_tables.py", line 17, in
cursor= conn.cursor()
File "/usr/lib/python2.6/site-packages/impala/hiveserver2.py", line 125, in cursor
session = self.service.open_session(user, configuration)
File "/usr/lib/python2.6/site-packages/impala/hiveserver2.py", line 995, in open_session
resp = self._rpc('OpenSession', req)
File "/usr/lib/python2.6/site-packages/impala/hiveserver2.py", line 923, in rpc
response = self._execute(func_name, request)
File "/usr/lib/python2.6/site-packages/impala/hiveserver2.py", line 940, in _execute
return func(request)
File "/usr/lib/python2.6/site-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 175, in OpenSession
return self.recv_OpenSession()
File "/usr/lib/python2.6/site-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 193, in recv_OpenSession
result.read(self._iprot)
File "/usr/lib/python2.6/site-packages/impala/_thrift_gen/TCLIService/TCLIService.py", line 1109, in read
fastbinary.decode_binary(self, iprot.trans, (self.
_class__, self.thrift_spec))
AttributeError: 'TBufferedTransport' object has no attribute 'trans'

展开
收起
爱吃鱼的程序员 2020-06-23 14:52:35 926 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    pipinstallthrift=0.9.3

    只执行rpc的时候调用方和被调用方的函数签名对不上,考虑各组件的版本问题。

    楼主,这个问题解决了吗

    2020-06-23 14:52:54
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载