質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Mecab

Mecabは、オープンソースの形態素解析エンジンです。 言語、辞書、コーパスに依存しない汎用的な設計を基本方針としています。 Mecabの由来は、開発者の好物である和布蕪(めかぶ)から名づけられました。

Q&A

解決済

1回答

2043閲覧

MeCabがインストールできない件

wakky

総合スコア20

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Mecab

Mecabは、オープンソースの形態素解析エンジンです。 言語、辞書、コーパスに依存しない汎用的な設計を基本方針としています。 Mecabの由来は、開発者の好物である和布蕪(めかぶ)から名づけられました。

0グッド

0クリップ

投稿2019/02/06 01:47

編集2019/02/06 02:09

前提・実現したいこと

MeCabをpython3にインストールしたいが以下のエラーがでます。対処を教えてください。

Python3.6.5
anadoda3-5.2
Ubuntu18.04

※書籍で勉強しています。

発生している問題・エラーメッセージ

$ pip3 install mecab-python3 Collecting mecab-python3 Downloading https://files.pythonhosted.org/packages/ac/48/295efe525df40cbc2173748eb869290e81a57e835bc41f6d3834fc5dad5f/mecab-python3-0.996.1.tar.gz Building wheels for collected packages: mecab-python3 Building wheel for mecab-python3 (setup.py) ... error Complete output from command /home/User/.pyenv/versions/anaconda3-5.2.0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_0warbr_/mecab-python3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-yqe2xhlb --python-tag cp36: /home/User/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running bdist_wheel running build running build_py running build_ext building '_MeCab' extension swigging MeCab.i to MeCab_wrap.cpp swig -python -shadow -c++ -I/usr/include -o MeCab_wrap.cpp MeCab.i unable to execute 'swig': No such file or directory error: command 'swig' failed with exit status 1 ---------------------------------------- Failed building wheel for mecab-python3 Running setup.py clean for mecab-python3 Failed to build mecab-python3 Installing collected packages: mecab-python3 Running setup.py install for mecab-python3 ... error Complete output from command /home/User/.pyenv/versions/anaconda3-5.2.0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_0warbr_/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 /tmp/pip-record-6oh17sp6/install-record.txt --single-version-externally-managed --compile: /home/User/.pyenv/versions/anaconda3-5.2.0/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/include -o MeCab_wrap.cpp MeCab.i unable to execute 'swig': No such file or directory error: command 'swig' failed with exit status 1 ---------------------------------------- Command "/home/User/.pyenv/versions/anaconda3-5.2.0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_0warbr_/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 /tmp/pip-record-6oh17sp6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-_0warbr_/mecab-python3/

その前にインストールしたこと

上記の前にこれをインストールしています。
$ sudo apt-get install -y libmecab-dev mecab-ipadic
$ sudo apt-get install -y mecab-ipadic-utf8
$ sudo apt-get install -y libc6-dev build-essential

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

coco_bauer

2019/02/06 01:51

エラーメッセージは全部質問に書いてください。省略しているところにエラーの詳細が書かれているのですから。
wakky

2019/02/06 02:09

失礼しました。更新しました
guest

回答1

0

ベストアンサー

unable to execute 'swig': No such file or directory

error: command 'swig' failed with exit status 1

sudo apt-get install swig でswigをインストールしてください。

投稿2019/02/06 02:25

kazto

総合スコア7196

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

wakky

2019/02/06 02:34

ありがとうございます。ただし、またエラーになりました。。。。 $ sudo apt-get install swing [sudo] password for user: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package swing その後、以下mecab-python3を試す-------------------------------------------- $ pip3 install mecab-python3 Collecting mecab-python3 Using cached https://files.pythonhosted.org/packages/ac/48/295efe525df40cbc2173748eb869290e81a57e835bc41f6d3834fc5dad5f/mecab-python3-0.996.1.tar.gz Building wheels for collected packages: mecab-python3 Building wheel for mecab-python3 (setup.py) ... error Complete output from command /home/User/.pyenv/versions/anaconda3-5.2.0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-j919tsio/mecab-python3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-3y6ph03p --python-tag cp36: /home/User/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running bdist_wheel running build running build_py running build_ext building '_MeCab' extension swigging MeCab.i to MeCab_wrap.cpp swig -python -shadow -c++ -I/usr/include -o MeCab_wrap.cpp MeCab.i unable to execute 'swig': No such file or directory error: command 'swig' failed with exit status 1 ---------------------------------------- Failed building wheel for mecab-python3 Running setup.py clean for mecab-python3 Failed to build mecab-python3 Installing collected packages: mecab-python3 Running setup.py install for mecab-python3 ... error Complete output from command /home/User/.pyenv/versions/anaconda3-5.2.0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-j919tsio/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 /tmp/pip-record-lgm12n25/install-record.txt --single-version-externally-managed --compile: /home/User/.pyenv/versions/anaconda3-5.2.0/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/include -o MeCab_wrap.cpp MeCab.i unable to execute 'swig': No such file or directory error: command 'swig' failed with exit status 1 ---------------------------------------- Command "/home/User/.pyenv/versions/anaconda3-5.2.0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-j919tsio/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 /tmp/pip-record-lgm12n25/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-j919tsio/mecab-python3/
kazto

2019/02/06 03:00

「swing」ではありません。「swig」です。
wakky

2019/02/06 07:43

失礼しました。。。あ、インストールできました!MeCabも無事できました。助かりました。ありがとうございます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問