You are trying to run a file that imports a mecab module.
I want to solve the problem that I get an error when I try to execute with a file even though Mecab can be used from the terminal.
When I try to execute a file that imports a mecab module, I get the following error:
Applicable source code
$python sample.py Traceback (most recent call last): File "sample.py", line 2, in<module> import Mecab ModuleNotFoundError: No module named 'Mecab'
When using mecab from the terminal
Supplemental information (FW/tool version etc.)
$mecab Sunny Sunny Noun, General, *, *, *, *, Sunny, Halle, Halle EOS
$mecab -v mecab of 0.996
Python 3.6.0 :: Anaconda 4.3.0
Answer # 1
Mecab is a command and has nothing to do with Python, so even if you can run mecab, you can't use modules with python.
You must install mecab's Python binding module for Python.
pip install mecab-python3is fine.
The package name of the Python binding module isUse
import MeCabinstead of
- macos (osx) - mac terminal error resolution (zsh: command not found: jupyter)
- macos (osx) - cobol and mac terminal error messages
- macos (osx) - docker error
- macos (osx) - jupyter lab chromedriver error
- macos (osx) - about fatal error displayed by git operation in terminal
- macos (osx) - the file exists, but i get an error such as no such file or directory
- macos (osx) - error in rsync command in shell script
- macos (osx) - error with --time-style option of zsh ls command
- macos (osx) - how to install macports terminal
- macos (osx) - how to solve the error in sublime text
- macos (osx) - path error @mac when arduino is installed in vs code
- macos (osx) - how to read file contents with backslash left in mac terminal
- macos (osx) - after inserting fish, the terminal of mac doesn't start
- macos (osx) - sort_valus method error macos
- macos (osx) - removed shell error when opening terminal on mac
- macos (osx) - keyboard operation of mac terminal
- macos (osx) - about error when constructing nodejs environment on mac
- macos (osx) - i want to fix bash_profile error (syntax error) in terminal
- macos (osx) - i want to resolve an error during command installation
- macos (osx) - dockerformac error of not specifying docker machine