Pyleus build发生import问题,pyleus通过thrift连接hbase

hellohhhello 2016-01-08 01:04:35
使用pyleus,在bolt中打算使用thrift连接hbase,因此有

from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from hbase import Hbase
from hbase.ttypes import *

由于有:
1、thrift-0.9.1.tar.gz(包含setup.py)
2、 requirements.txt中thrift

thrift的import正常,

但是在hbase import的时候,总是报ImportError: No module named hbase。这个该如何处理呢?

thrift有pip源。hbase能否也找到相应的文件呢?

具体错误信息如下:
[root@vm-kafka01]# pyleus --verbose build word_count/pyleus_topology.yaml
New python executable in /tmp/tmp9CgVsa/resources/pyleus_venv/bin/python
Installing setuptools, pip, wheel...done.
Collecting pyleus==0.2.2
Collecting msgpack-python (from pyleus==0.2.2)
Requirement already satisfied (use --upgrade to upgrade): argparse in /tmp/tmp9CgVsa/resources/pyleus_venv/lib/python2.6/site-packages (from pyleus==0.2.2)
Collecting virtualenv (from pyleus==0.2.2)
Collecting PyYAML (from pyleus==0.2.2)
DEPRECATION: Failed to find 'PyYAML' at http://172.17.18.61/simple/pyyaml/. It is suggested to upgrade your index to support normalized names as the name in /simple/{name}.
Installing collected packages: msgpack-python, virtualenv, PyYAML, pyleus
Successfully installed PyYAML-3.11 msgpack-python-0.4.2 pyleus-0.2.2 virtualenv-13.1.2
Processing /tmp/thrift
Installing collected packages: thrift
Running setup.py install for thrift
Successfully installed thrift-0.9.1

pyleus build: error: [VirtualenvError] Failed to execute Python module: word_count.log_results. Error: Traceback (most recent call last):
File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
File "/tmp/tmp9CgVsa/resources/word_count/log_results.py", line 7, in <module>
from hbase import Hbase
ImportError: No module named hbase



多谢~~
...全文
557 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hellohhhello 2016-01-12
  • 打赏
  • 举报
回复
多谢~~ 刚刚手滑就提交了,谢谢~~ 如果有时间的话,能不能再帮忙看看后续 [root@vm-kafka01]# pyleus --verbose build word_count/pyleus_topology.yaml New python executable in /tmp/tmpCK2Zj3/resources/pyleus_venv/bin/python Installing setuptools, pip, wheel...done. Collecting pyleus==0.2.2 Collecting msgpack-python (from pyleus==0.2.2) Requirement already satisfied (use --upgrade to upgrade): argparse in /tmp/tmpCK2Zj3/resources/pyleus_venv/lib/python2.6/site-packages (from pyleus==0.2.2) Collecting virtualenv (from pyleus==0.2.2) Collecting PyYAML (from pyleus==0.2.2) DEPRECATION: Failed to find 'PyYAML' at http://IP/simple/pyyaml/. It is suggested to upgrade your index to support normalized names as the name in /simple/{name}. Installing collected packages: msgpack-python, virtualenv, PyYAML, pyleus Successfully installed PyYAML-3.11 msgpack-python-0.4.2 pyleus-0.2.2 virtualenv-13.1.2 Processing /tmp/thrift Processing /tmp/hbase Requirement already satisfied (use --upgrade to upgrade): setuptools in /tmp/tmpCK2Zj3/resources/pyleus_venv/lib/python2.6/site-packages (from hbase==3.7.0->-r /opt/app/liu_rui/word_count/requirements.txt (line 2)) Collecting desktop (from hbase==3.7.0->-r /opt/app/liu_rui/word_count/requirements.txt (line 2)) Downloading http://172.17.18.61/simple/desktop/desktop-0.4.2.tar.gz Building wheels for collected packages: desktop Running setup.py bdist_wheel for desktop Stored in directory: /root/.cache/pip/wheels/69/dd/ff/be6fb6413114485eb970551127a913f2232c3560cbdafc2dbd Successfully built desktop Installing collected packages: thrift, desktop, hbase Running setup.py install for thrift Running setup.py install for hbase Successfully installed desktop-0.4.2 hbase-3.7.0 thrift-0.9.1 pyleus build: error: [VirtualenvError] Failed to execute Python module: word_count.log_results. Error: Traceback (most recent call last): File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code exec code in run_globals File "/tmp/tmpCK2Zj3/resources/word_count/log_results.py", line 7, in <module> from hbase import Hbase ImportError: cannot import name Hbase 这怎么前后还不一样,hbase这个到底import了没~~
hellohhhello 2016-01-12
  • 打赏
  • 举报
回复
您好: desktop的pip源已经加上了,上面的问题也就不再了。
hellohhhello 2016-01-11
  • 打赏
  • 举报
回复
多谢~~ 用您的方法,果然解决了,谢谢 可是现在又有这么个问题,说是在pip源上找不到desktop,我理解,是不是一定要在pip源上加上这个才可以,这个和hbase的使用又有什么关系呢?因为加pip源还要再去找别的同事,好麻烦的,不知道能不能本地解决呢,多谢 [root@vm-kafka01 ]# pyleus --verbose build word_count/pyleus_topology.yaml New python executable in /tmp/tmpL8oDPZ/resources/pyleus_venv/bin/python Installing setuptools, pip, wheel...done. Collecting pyleus==0.2.2 Collecting msgpack-python (from pyleus==0.2.2) Requirement already satisfied (use --upgrade to upgrade): argparse in /tmp/tmpL8oDPZ/resources/pyleus_venv/lib/python2.6/site-packages (from pyleus==0.2.2) Collecting virtualenv (from pyleus==0.2.2) Collecting PyYAML (from pyleus==0.2.2) DEPRECATION: Failed to find 'PyYAML' at http://pip源ip/simple/pyyaml/. It is suggested to upgrade your index to support normalized names as the name in /simple/{name}. Installing collected packages: msgpack-python, virtualenv, PyYAML, pyleus Successfully installed PyYAML-3.11 msgpack-python-0.4.2 pyleus-0.2.2 virtualenv-13.1.2 Processing /tmp/thrift Processing /tmp/hbase Requirement already satisfied (use --upgrade to upgrade): setuptools in /tmp/tmpL8oDPZ/resources/pyleus_venv/lib/python2.6/site-packages (from hbase==3.7.0->-r /opt/app/word_count/requirements.txt (line 2)) Collecting desktop (from hbase==3.7.0->-r /opt/app/word_count/requirements.txt (line 2)) DEPRECATION: Failed to find 'desktop' at http://pip源ip/simple/desktop/. It is suggested to upgrade your index to support normalized names as the name in /simple/{name}. Could not find a version that satisfies the requirement desktop (from hbase==3.7.0->-r /opt/app/word_count/requirements.txt (line 2)) (from versions: ) No matching distribution found for desktop (from hbase==3.7.0->-r /opt/app/word_count/requirements.txt (line 2)) pyleus build: error: [VirtualenvError] Failed to install dependencies for this topology. Run with --verbose for detailed info.
pcboyxhy 2016-01-08
  • 打赏
  • 举报
回复
Okay, I figured it out. If anyone else is having problems with this in the future its actually pretty easy. In the step where you run thrift --gen py Hbase.thrift, it creates a hbase folder in the location you ran that command. Simply take that command and copy it to your default module folder(or in the folder where you run your program and it should work).
源码下载地址: https://pan.quark.cn/s/40677b766bda "ContextCapture 倾斜摄影快速、创新及全面空三建模与单机集群硬件部署方案2018" 此资源聚焦于倾斜摄影(ContextCapture)空三建模及单机集群硬件部署方案,致力于为用户呈现最快、最优成本效益的台式工作站、移动工作站、并行集群的多样化部署选择。以下是该资源的详细知识点概述: 一、相关设备型号说明 * UltraLAB 是西安坤隆计算机科技有限公司推出的专属图形工作站品牌,具备三大卓越优势:顶尖的计算硬件架构、精准的行业应用定制服务、专业的硬件系统优化工艺。 二、硬件部署方案 * 台式工作站部署建议:设备特色在于当前市场上最快的台式计算架构,适用于办公场景下,部门层级常规的倾斜摄影空三处理、三维建模。 * 便携式工作站部署建议:设备特色在于当前市场上最快的移动计算架构,适用于移动倾斜摄影的空三处理、三维建模工作站。 * 大数据量处理工作站推荐:设备特色在于极限自动超频加速与16个并行存储构造,具备空三处理和三维建模最强的计算性能及海量高速并行存储性能。 * 多设备并行计算集群部署建议:针对海量图像数据计算产生的巨大需求,单机计算能力处理时间过长,效率不高,通过多台机器并行集群,进行空三处理、三维建模,显著减少处理时间。 三、部署方案深入解析 * 2.1 倾斜摄影建模(台式工作站)部署方案:设备特色在于最高的计算处理能力~6核5.2GHz,内存最大配置可达64GB,配备最新图灵架构的RTX显卡,相比市场其他品牌机器(单CPU、双Xeon处理器)更快、更具成本效益。 * 2.2 倾斜摄影建模(移动便携式工作站)硬件部署方案:设备特色在于最高的计算处理能力~6...

37,738

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧