Python中文
首页
教程
问答
标签
搜索
登录
注册
Apachorm与python ModuleNotFound混合拓扑错误:没有名为“storm”的模块
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在尝试创建一个混合风暴拓扑,它使用基于Java的spout和基于python的bolt。在</p> <p>对于基于python的bolt,我编写了一个Java包装器:</p> <pre><code>class PythonBolt extends ShellBolt implements IRichBolt { public PythonBolt() { super("python", "C:\\somepath\\sample.py"); } @Override public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { } @Override public Map<String, Object> getComponentConfiguration() { return null; } } </code></pre> <p>这就是我的样品.py看起来像:</p> <p>进口风暴</p> ^{pr2}$ <p>然后我把它们放在一起,试着通过下面的片段运行:</p> <pre><code>public class SampleBolt { public static void main(String[] args) throws Exception { TopologyBuilder builder = new TopologyBuilder(); builder.setSpout("Hello", new RawDataLevelSpout(), 12); builder.setBolt("World", new PythonBolt(), 12); Config config = new Config(); config.setDebug(true); LocalCluster cluster = new LocalCluster(); cluster.submitTopology("Hello-World-BaiJian", config, builder.createTopology()); Utils.sleep(100000); cluster.killTopology("Hello-World-BaiJian"); cluster.shutdown(); } } </code></pre> <p>所有的启动都是正确的,但是,我得到了以下例外:</p> <pre><code>import storm ModuleNotFoundError: No module named 'storm' at org.apache.storm.utils.ShellProcess.launch(ShellProcess.java:94) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] at org.apache.storm.task.ShellBolt.prepare(ShellBolt.java:154) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] at org.apache.storm.executor.bolt.BoltExecutor.init(BoltExecutor.java:84) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] at org.apache.storm.executor.bolt.BoltExecutor.call(BoltExecutor.java:93) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] at org.apache.storm.executor.bolt.BoltExecutor.call(BoltExecutor.java:45) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] at org.apache.storm.utils.Utils$2.run(Utils.java:329) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] </code></pre> <p>关于如何克服这个问题有什么建议吗?如何安装python storm包?有没有可能通过水蟒安装它(我找不到软件包)?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>当您从IDE运行多语言支持时,我不确定多语言支持是否适用于LocalCluster。见<a href="https://stackoverflow.com/a/32085316/8845188">https://stackoverflow.com/a/32085316/8845188</a>。在回答之后的对话中似乎提到了一个解决办法。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
5 回答
无法使用Django\u mssql\u后端迁移到外部hos
3 回答
无法使用Django&Python3.4连接到MySql
5 回答
无法使用Django+nginx上载媒体文件
7 回答
无法使用Django1.6导入名称模式
8 回答
无法使用Django1.7和mongodb登录管理站点
1 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
10 回答
无法使用Djangockedi验证CBV中的字段
5 回答
无法使用Djangocketditor上载图像(错误400)
2 回答
无法使用Djangocron进行函数调用
1 回答
无法使用Djangofiler djang上载文件
8 回答
无法使用Djangokronos
1 回答
无法使用Djangomssql provid
2 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
9 回答
无法使用Djangomssq迁移Django数据库
2 回答
无法使用Djangonox创建用户
5 回答
无法使用Djangopyodb从Django查询SQL Server
9 回答
无法使用Djangopython3ldap连接到ldap
9 回答
无法使用Djangoredis连接到redis
9 回答
无法使用Django中的FK创建新表
6 回答