impyla-0.14.2.2安装注意事项

Posted zhaohz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了impyla-0.14.2.2安装注意事项相关的知识,希望对你有一定的参考价值。

### impyla-0.14.2.2安装注意事项
+ 环境
- Red Hat Enterprise Linux Server release 6.8 (Santiango)
- Python3.7.3

+ impyla-0.14.2.2依赖包
- yum install -y python-devel cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib
- thrift - 0.11.0
- sasl - 0.2.1
- thrift_sasl - 0.2.1
- thriftpy - 0.3.9

+ 问题1: syntax error near ‘async=True)‘ 报错
- hiveserver2.py 第340行 `async=True)` 改为 `async2=True)` (估计async是关键字)
- hiveserver2.py 第1022行 `async=False)` 改为 `async2=False)`
- hiveserver2.py 第1026行 `=async)` 改为 `=async2)`

+ 问题2:‘TSocket‘ object has no attribute ‘isOpen‘报错?
- 把 thrift_sasl 从0.3.0换成0.2.1版本 (在python2.7中0.3.0没问题)

+ 问题3:No protocol version header
- connect函数需要指定 user, password, auth_mechanism = ‘PLAIN‘

+ 问题4:报错sasl/sasl.h: No such file or directory
- yum install -y cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib

+ 示例

```python

from impala.dbapi import connect

conn = connect(host=‘hadoop01‘, port=10000, user=‘hadoop‘, password=‘hadoop‘, auth_mechanism = ‘PLAIN‘)
cursor = conn.cursor()
cursor.execute(‘SHOW DATABASES‘)
for result in cursor.fetchall():
print(result)

```

+ 注意启动hiveserver2
```bash
nohup hive --service hiveserver2 > nohup.hiveserver2&
```

以上是关于impyla-0.14.2.2安装注意事项的主要内容,如果未能解决你的问题,请参考以下文章

SqlServer20172019安装注意事项

python安装插件包注意事项

安装python注意事项

gis安装注意事项都有哪些

VMware 安装 Mac OS 注意事项

源码安装nginxmysql的注意事项