您的位置:首页 > 编程语言 > PHP开发

ThriftParserError: ThriftPy does not support generating module with path in protocol 'd'

2017-08-30 13:36 597 查看
使用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 进行编译,即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python hive ThriftPy
相关文章推荐