ThriftParserError: ThriftPy does not support generating module with path in protocol 'd'
使用python連接hive,在
from impala.dbapi import connect ?語句報如下錯誤:
ThriftParserError: ThriftPy does not support generating module with path in protocol 'd'
定位到?D:\Anaconda3\Lib\site-packages\thriftpy\parser\parser.py的
? ? if url_scheme == '':
? ? ? ? with open(path) as fh:
? ? ? ? ? ? data = fh.read()
? ? elif url_scheme in ('http', 'https'):
? ? ? ? data = urlopen(path).read()
? ? else:
? ? ? ? raise ThriftParserError('ThriftPy does not support generating module '
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'with path in protocol \'{}\''.format(
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? url_scheme))
更改為
? ? if url_scheme == '':
? ? ? ? with open(path) as fh:
? ? ? ? ? ? data = fh.read()
? ? elif url_scheme in ('c', 'd','e','f''):
? ? ? ? with open(path) as fh:
? ? ? ? ? ? data = fh.read()
? ? elif url_scheme in ('http', 'https'):
? ? ? ? data = urlopen(path).read()
? ? else:
? ? ? ? raise ThriftParserError('ThriftPy does not support generating module '
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'with path in protocol \'{}\''.format(
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? url_scheme))
命令行使用python -m py_comile parser.py 進行編譯,即可
總結
以上是生活随笔為你收集整理的ThriftParserError: ThriftPy does not support generating module with path in protocol 'd'的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 圆满了!曝小米三大新旗舰全系上12+51
- 下一篇: 头部主播“消失”后的618:去头部化成共