◆環境:MacBook、Python3、IDLE
◆状況:ターミナルからpip install mecab-python3
と入力しても、40行くらいの長文エラーが表示され、インストールが出来ません。
ただ、brew install mecab-python3
と入力すると、インストール出来ているようで、ターミナルでmecab
と入力すれば、MeCabの機能が使えるモードに移行します。
そこで、PythonのIDLE機能で.pyファイルを作成し、import MeCab
と入力して実行してみると、ModuleNotFoundError: No module named 'MeCab'
とエラーになってしまいます。
初心者なので不明なのですが、どうやら、MeCab自体は当MacBookに入れられたものの、IDLEで呼び出せない状態のようです。
解消方法(IDLEでMeCabが呼び出せる方法)をご教示頂きたく、よろしくお願いします。
◆エラー文
Collecting mecab-python3 Using cached https://files.pythonhosted.org/packages/ac/48/295efe525df40cbc2173748eb869290e81a57e835bc41f6d3834fc5dad5f/mecab-python3-0.996.1.tar.gz Installing collected packages: mecab-python3 Running setup.py install for mecab-python3 ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/13/tfmf9tkx517ghsvbz38qplsr0000gn/T/pip-install-ho6g1y0a/mecab-python3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/13/tfmf9tkx517ghsvbz38qplsr0000gn/T/pip-record-zl4mpum3/install-record.txt --single-version-externally-managed --compile: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running install running build running build_py running build_ext building '_MeCab' extension swigging MeCab.i to MeCab_wrap.cpp swig -python -shadow -c++ -I/usr/local/include -o MeCab_wrap.cpp MeCab.i /usr/local/include/mecab.h:848: Warning 302: Identifier 'set_sentence' redefined by %extend (ignored), MeCab.i:89: Warning 302: %extend definition of 'set_sentence'. creating build creating build/temp.macosx-10.6-intel-3.6 /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c MeCab_wrap.cpp -o build/temp.macosx-10.6-intel-3.6/MeCab_wrap.o warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] MeCab_wrap.cpp:3051:10: fatal error: 'stdexcept' file not found #include <stdexcept> ^~~~~~~~~~~ 1 warning and 1 error generated. error: command '/usr/bin/clang' failed with exit status 1 ---------------------------------------- Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/13/tfmf9tkx517ghsvbz38qplsr0000gn/T/pip-install-ho6g1y0a/mecab-python3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/13/tfmf9tkx517ghsvbz38qplsr0000gn/T/pip-record-zl4mpum3/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/13/tfmf9tkx517ghsvbz38qplsr0000gn/T/pip-install-ho6g1y0a/mecab-python3/
あなたの回答
tips
プレビュー