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

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

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

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

Mecab

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

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

4057閲覧

Google Colaboratoryでmecabをインストールできない!

wataoka

総合スコア11

Python 3.x

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

Mecab

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

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2018/11/20 04:58

質問

Google Colaboratoryでmecabをインストールできなくなりました。

こちらのサイトを参考にし、

command

1!apt install aptitude 2!aptitude install mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file -y 3!pip install mecab-python3

というコマンドを実行することで以前まではmecabをインストールできていたのですが、2018年11月20日現在では下のようなエラーを吐き出しました。

どなたかご教授お願いいたします。。。

エラー

command

1Reading package lists... Done 2Building dependency tree 3Reading state information... Done 4aptitude is already the newest version (0.8.10-6ubuntu1). 50 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. 6mecab is already installed at the requested version (0.996-5) 7libmecab-dev is already installed at the requested version (0.996-5) 8mecab-ipadic-utf8 is already installed at the requested version (2.7.0-20070801+main-1) 9git is already installed at the requested version (1:2.17.1-1ubuntu0.3) 10make is already installed at the requested version (4.1-9.1ubuntu1) 11curl is already installed at the requested version (7.58.0-2ubuntu3.5) 12xz-utils is already installed at the requested version (5.2.2-1.3) 13file is already installed at the requested version (1:5.32-2ubuntu0.1) 14mecab is already installed at the requested version (0.996-5) 15libmecab-dev is already installed at the requested version (0.996-5) 16mecab-ipadic-utf8 is already installed at the requested version (2.7.0-20070801+main-1) 17git is already installed at the requested version (1:2.17.1-1ubuntu0.3) 18make is already installed at the requested version (4.1-9.1ubuntu1) 19curl is already installed at the requested version (7.58.0-2ubuntu3.5) 20xz-utils is already installed at the requested version (5.2.2-1.3) 21file is already installed at the requested version (1:5.32-2ubuntu0.1) 22No packages will be installed, upgraded, or removed. 230 packages upgraded, 0 newly installed, 0 to remove and 5 not upgraded. 24Need to get 0 B of archives. After unpacking 0 B will be used. 25 26Collecting mecab-python3 27 Using cached https://files.pythonhosted.org/packages/ac/48/295efe525df40cbc2173748eb869290e81a57e835bc41f6d3834fc5dad5f/mecab-python3-0.996.1.tar.gz 28Building wheels for collected packages: mecab-python3 29 Running setup.py bdist_wheel for mecab-python3 ... error 30 Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-em9qsf_o/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-17duzg46 --python-tag cp36: 31 running bdist_wheel 32 running build 33 running build_py 34 running build_ext 35 building '_MeCab' extension 36 swigging MeCab.i to MeCab_wrap.cpp 37 swig -python -shadow -c++ -I/usr/include -o MeCab_wrap.cpp MeCab.i 38 unable to execute 'swig': No such file or directory 39 error: command 'swig' failed with exit status 1 40 41 ---------------------------------------- 42 Failed building wheel for mecab-python3 43 Running setup.py clean for mecab-python3 44Failed to build mecab-python3 45Installing collected packages: mecab-python3 46 Running setup.py install for mecab-python3 ... error 47 Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-em9qsf_o/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-ye_qwmo7/install-record.txt --single-version-externally-managed --compile: 48 running install 49 running build 50 running build_py 51 running build_ext 52 building '_MeCab' extension 53 swigging MeCab.i to MeCab_wrap.cpp 54 swig -python -shadow -c++ -I/usr/include -o MeCab_wrap.cpp MeCab.i 55 unable to execute 'swig': No such file or directory 56 error: command 'swig' failed with exit status 1 57 58 ---------------------------------------- 59Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-em9qsf_o/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-ye_qwmo7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-em9qsf_o/mecab-python3/

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

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

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

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

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

guest

回答1

0

自己解決

自己解決しました!

下記サイトに記載されています通り、swigをinstallすることで解決しました。

https://qiita.com/siraasagi/items/e07e0b271cb7cd679a70

投稿2018/11/20 05:17

wataoka

総合スコア11

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問