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



多谢~~
...全文
569 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/387d7c8f6289 在使用IE浏览器的过程中,偶尔会出现重置为默认配置操作未能顺利完成的现象。这种情况的发生可能源于多种因素,包括注册表项出现偏差、浏览器附加组件之间存在不兼容、操作系统授权设置不当或受到恶意程序影响等。针对这一挑战,我们可以通过一系列系统性的方法来逐一诊断和纠正。首先需要验证当前用户是否具备管理员级别的操作权限。在执行重置配置的操作时,必须确保IE浏览器是以管理员身份启动的。具体操作方式为,使用鼠标右键单击IE程序图标,并从弹出的菜单中选择“以管理员身份运行”这一选项。其次,应当检查是否存在恶意软件。恶意程序有时会非法修改浏览器的配置信息,从而阻碍重置过程的正常进行。用户可以借助Windows系统自带的Microsoft Safety Scanner进行检测,或者选择安装并使用第三方安全防护软件执行全面的系统扫描。紧接着,需要对浏览器的缓存数据以及Cookies文件进行清理。在IE浏览器界面中,通过访问“工具”菜单并选择“Internet选项”,然后在弹出的设置界面中,切换至“常规”标签页,并执行清除浏览历史记录的操作,此过程应包含Cookies和临时互联网文件。倘若上述步骤均未能解决问题,那么可以考虑禁用或移除那些可能引发冲突的浏览器附加组件。相关操作需要在“工具”菜单下找到并打开“管理加载项”,对可疑的插件进行禁用处理,并在浏览器重新启动后再次尝试执行重置操作。再者,修复IE浏览器相关的注册表配置也是至关重要的环节。注册表编辑器是一个功能强大的系统工具,任何不当的操作都可能导致严重的系统问题,因此在进行修改前必须创建系统还原点作为安全备份。用户可以通过按下“Win+R”组合...
内容概要:本文详细介绍了光伏储能虚拟同步发电机(VSG)并网仿真模型的Simulink实现方法,系统研究了光伏发电与储能系统融合VSG技术并入电网的动态特性与控制策略。通过构建完整的VSG控制模块,模拟其在并网过程中的虚拟惯性响应、频率调节能力和有功无功功率支撑特性,验证了该系统在增强电网稳定性、提升新能源并网适应性方面的有效性。模型全面涵盖光伏出力特性、储能系统充放电管理、VSG有功-无功解耦控制、下垂控制机制以及并网点动态响应等关键环节,并通过多种工况下的仿真分析,评估系统在不同运行条件下的动态性能与鲁棒性。; 适合人群:具备电力系统、新能源发电、自动控制等相关专业背景,熟悉Matlab/Simulink仿真环境,从事新能源并网、微电网控制或电力电子系统研究的科研人员、工程技术人员及研究生。; 使用场景及目标:①深入理解光伏储能系统如何通过VSG技术模拟同步发电机的惯性和阻尼特性以支持电网稳定;②掌握虚拟惯量控制、下垂控制等VSG核心控制策略在Simulink中的建模、参数设计与实现方法;③为新型电力系统中新能源并网的动态仿真、稳定性分析及控制策略优化提供可靠的模型基础和技术参考。; 阅读建议:建议结合所提供的仿真模型进行逐步操作与参数调试,重点关注VSG控制环路的结构设计、控制器参数整定及其对系统动态性能的影响,同时可将该模型拓展应用于多机并联、微电网孤岛/并网切换、多能源协同控制等更复杂的系统场景中进行进阶研究。

37,737

社区成员

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

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