python 安装impala报错及解决办法
from impala.dbapi import connect
执行的时候报connect找不到 ,如果只 pip安装impyla是不行的.
https://github.com/cloudera/impyla
官网可以看到依赖的包
Dependencies
Required:
Python 2.6+ or 3.3+
six
,bit_array
thrift
Optional:
thrift_sasl==0.2.1
for hive and/or Kerberos support:pandas
for conversion toDataFrame
objects; but see the Ibis project insteadsqlalchemy
for the SQLAlchemy enginepytest
for running tests;unittest2
for testing on Python 2.6
主要是thrift比较难安装
直接啪会报错 :
ERROR: Complete output from command /Users/didi/.conda/envs/19july/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/2w/tt1p_4td3yq9xlbl7c2t4jn00000gn/T/pip-install-ogzftbd1/thriftpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/2w/tt1p_4td3yq9xlbl7c2t4jn00000gn/T/pip-wheel-_dsc9rzz --python-tag cp37:
ERROR: running bdist_wheel
The [wheel] section is deprecated. Use [bdist_wheel] instead.
......
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for thriftpy
......
note: 'curexc_value' declared here
PyObject *curexc_value;
^
thriftpy/transport/cybase.c:3189:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
tmp_tb = tstate->exc_traceback;
^~~~~~~~~~~~~
curexc_traceback
解决办法 pip install cython
然后 pip install thriftpy 就没事了
又报错了: ModuleNotFoundError: No module named 'thrift_sasl'
如上面的optional里面有这个包 看来不是可选啊 也是必选的.sasl报错
ERROR: Complete output from command /Users/didi/.conda/envs/19july/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/2w/tt1p_4td3yq9xlbl7c2t4jn00000gn/T/pip-install-cw5r7bt2/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/2w/tt1p_4td3yq9xlbl7c2t4jn00000gn/T/pip-wheel-2b5qj55e --python-tag cp37:
thrift_sasl也报错了 这个时候切换conda安装 发现很多依赖包 自己识别了
但是最开始的impala安装conda是没有识别依赖包的
最后一点看到左边的项目了吧 安装包一定要安装在项目里 我之前都习惯安装在base 其实是错的
当一切就绪之后又报了hiveserve2 的错误 ,又报了hive内的执行错误 ,impala async=True ...........
但是机智的我已经看出来那不是包安装的问题了.Python 3.7 introduced a change which made async
a reserved keyword
>>> from impala.dbapi import connect
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "../.venv/lib/python3.7/site-packages/impala/dbapi.py", line 28, in <module>import impala.hiveserver2 as hs2File "../.venv/lib/python3.7/site-packages/impala/hiveserver2.py", line 340async=True)^
SyntaxError: invalid syntax
果真百度不到了 谷歌到了 https://github.com/cloudera/impyla/issues/312
问题就是python 3.7 对impyla的版本支持有问题 最新的不行 需要指定这个版本
pip install impyla==0.15a1
问题解决了 执行 生产文件
info_sql = impala_conn.cursor()
# info_sql.execute(
# '''set mapreduce.job.queuename=root.a-a.a-ai;''')
# 执行HQL语句
# 取出来数据
info_sql.execute(sql_sequnce)
info_data = info_sql.fetchall()
dt1 = pd.DataFrame(info_data, columns=['a', 'a', 'a', 'a', 'a'])
dt2=dt1[:1000]
dt2.to_csv('/Users/a/gongcheng/tyty.csv',encoding='utf-8-sig')
敏感数据我都aaaa了
解决了
python 安装impala报错及解决办法相关推荐
- Ubuntu安装Gems报错的解决办法
安装执行: sudo -u git -H bundle install --deployment --without development test postgres 安装的时候出现了两个问题 第一 ...
- win7 64下安装mysql-python报错的解决办法
转自博客园楚狂人阿飞 原文地址:http://www.cnblogs.com/fireflow/p/4598526.html 最近要使用django进行项目开发,需要使用mysql-python模块. ...
- MongoDB在安装过程中权限不足无法安装服务报错的解决办法
报错:Service'MongoDB Server' failed to start. Verify that you have sufficient privileges to start syst ...
- windows 功能中安装Hyper-V报错 0x80073701解决办法
使用 PowerShell 启用 Hyper-V 以管理员身份打开 PowerShell 控制台. 运行以下命令: PowerShell复制 Enable-WindowsOptionalFeature ...
- 【已解决】Python安装TensorFlow报错“Consider adding this directory to PATH or, if you prefer to suppress this
[已解决]Python安装TensorFlow报错"Consider adding this directory to PATH or, if you prefer to suppress ...
- node-sass安装失败、报错、解决办法总结
node-sass安装失败.报错.解决办法总结 1.首先需要考虑三个方面的问题: (1.) Node版本,node-sass版本,python版本. node版本建议用node12,可以查一下Node ...
- Xamarin开发安装Visual Studio 2015 update2报错的解决办法
Xamarin开发安装Visual Studio 2015 update2报错的解决办法 错误信息:update 2 requires a member of the visual studio 20 ...
- python安装报错类型_解决Python安装cryptography报错问题
解决Python安装cryptography报错问题 错误一: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wst ...
- CAD、3dmax等Autodesk系列软件安装报错1603解决办法
一级标题CAD.3dmax等Autodesk系列软件安装报错1603解决办法 使用Auto Remove清理后,安装报错1603 ,如下图 该错误只会出现在2020和2021版本上,其他版本不存在该问 ...
最新文章
- 【高性价比】AIO-3288C四核高性能主板
- 每日一皮:程序员新手尝试新框架的时候
- 复旦大学跑步爱好者协会章程(终稿)
- http 协议上传文件multipart form-data boundary 说明--转载
- Flutter 34: 图解自定义 View 之 Canvas (一)
- 好文推荐 | 缓存与数据库一致性问题深度剖析 (修订)
- linux卸载db2cli,DB2 for linux 安装
- 【HDU - 1237】简单计算器 (栈模拟)
- 网易云api如何调用_分析网易云音乐API的经历
- 解决mysql分页数据错乱问题
- 小程序 - 首次使用
- 第一章 如何学习单片机
- 英文科技论文写作与学术报告2021秋期末考答案|网课期末考答案|学堂在线|清华大学管晓宏教授
- ASP.NET在线考试系统+文档说明
- 小米8青春版android版本,小米8青春版和小米8什么区别 小米8青春版和小米8对比...
- Parallels Desktop启动后黑屏无法进入Windows系统
- 第十六节 桥、桥、桥,得一桥得天下
- 大数据的5大关键技术点
- 对于interrupt,interrupted 和 isInterrupted的一些理解
- java英文自我介绍3篇_java开发英文自我介绍