python 连接impala报错(windows系统)

错误

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

看anaconda安装在哪个盘,就会报错‘d’或者‘e’。

原因:

路径不对。
定位到 D:\Anaconda3\Lib\site-packages\thriftpy\parser\parser.py
的,第487行修改。

 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))

猜你喜欢

转载自blog.csdn.net/minixuezhen/article/details/78801169