I download a piece of work data from the Aozora Bunko and use Janome to make a program that gets parts of speech, but I get an error when I install janome. What should I do?

Applicable source code
import urllib.request
from janome.analyzer import Analyzer
from janome.charfilter import *
from janome.tokenizer import Tokenizer

class MainTextCharFilter (CharFilter):
    def __init __ (self, start, end):
        self.start = start
        self.end = end
    def apply (self, text):
        return text.split (self.start) [1] .split (self.end) [0]
# Natsume Soseki
# I'm a cat
html = ''
with urllib.request.urlopen (url) as response:
    html = response.read (). decode ('shift_jis')

char_filters = [UnicodeNormalizeCharFilter (),
                MainTextCharFilter ('<div>', '<div>'),
                RegexReplaceCharFilter ('<rp>\ (. *? \)</rp>', ''),
                RegexReplaceCharFilter ('<. *?>', '')]
tokenizer = Tokenizer ()
analyzer = Analyzer (char_filters, tokenizer)
for token in analyzer.analyze (html):
    print (token)
Error message
Traceback (most recent call last):
  File "directory name", line 3, in<module>
    from janome.analyzer import Analyzer
ModuleNotFoundError: No module named 'janome'
janome installation screen (Anaconda prompt)

Add a response Result of entering pip show janome

Result of entering import sys;print (sys.prefix)

  • Answer # 1

    At the Anaconda prompt

    pip show janome
    Confirm the installation destination as


    On python code

    import sys;print (sys.prefix)

    to check the installation destination of the interpreter that is running.

    If you don't have janome installed in the latter directory, something may be wrong.

    If it is difficult to judge, please tell us the results.