0

I am trying to run Apache storm topology with Python bolt using shell bolt. In my bolt i am using spacy library which i have installed in /home/labuser/anaconda3/bin/python. However when i run topology storm displays error message module not found spacy. After debugging i found that storm is using python 2.7 located in /usr/bin/python .

My question is an extension to question below, In storm, how to specify specific version of python

as per answer in the question above i tried to create shell bolt using super("home/labuser/anaconda3/bin/python", "splitsentence.py"); constructor but yet storm continues to pick up 2.7 in /usr/bin/python dir.

I need to know how i could tell storm to use python3 in home/labuser/anaconda3/bin/python directory for my shell bolt.

chans.best
  • 13
  • 4

1 Answers1

0

It turns out that specifying which python version to use in constructor of shell bolt of implementation is the answer.I had tried this one initially but due to some other build issues it was failing.I did a fresh build and now it works.

public static class SplitSentence extends ShellBolt implements IRichBolt {

    public SplitSentence() {
      super("home/labuser/anaconda3/bin/python", "splitsentence.py");
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer declarer) {
      declarer.declare(new Fields("word"));
    }

    @Override
    public Map<String, Object> getComponentConfiguration() {
      return null;
    }
  }

all thanks to this answer In storm, how to specify specific version of python

If you have any other issues make sure to read http://storm.apache.org/releases/2.0.0-SNAPSHOT/Multilang-protocol.html

chans.best
  • 13
  • 4