mecab-pythonのインストールに失敗しまし
先ほどmecabのインストールに成功して、今度はmecab-pythonをインストールしようとしたら、失敗したようです。
参考にしたサイトは以下です
http://tatsuyaoiw.hatenablog.com/entry/20120414/1334405065
●mecabのインストール直後
root@debian:/usr/local# mecab
参考までに、私がインストールした手順を下に書きます。
参考 名詞,サ変接続,*,*,*,*,参考,サンコウ,サンコー
まで 助詞,副助詞,*,*,*,*,まで,マデ,マデ
に 助詞,格助詞,一般,*,*,*,に,ニ,ニ
、 記号,読点,*,*,*,*,、,、,、
私 名詞,代名詞,一般,*,*,*,私,ワタシ,ワタシ
が 助詞,格助詞,一般,*,*,*,が,ガ,ガ
インストール 名詞,一般,*,*,*,*,インストール,インストール,インストール
し 動詞,自立,*,*,サ変・スル,連用形,する,シ,シ
た 助動詞,*,*,*,特殊・タ,基本形,た,タ,タ
手順 名詞,一般,*,*,*,*,手順,テジュン,テジュン
を 助詞,格助詞,一般,*,*,*,を,ヲ,ヲ
下 名詞,一般,*,*,*,*,下,シタ,シタ
に 助詞,格助詞,一般,*,*,*,に,ニ,ニ
書き 動詞,自立,*,*,五段・カ行イ音便,連用形,書く,カキ,カキ
ます 助動詞,*,*,*,特殊・マス,基本形,ます,マス,マス
。 記号,句点,*,*,*,*,。,。,。
EOS
^Z
●ここからmecab-pythonインストール開始
root@debian:/usr/local# wget *ttp://mecab.googlecode.com/files/mecab-python-0.993.tar.gz
--2015-01-08 06:05:07-- *ttp://mecab.googlecode.com/files/mecab-python-0.993.tar.gz
mecab.googlecode.com (mecab.googlecode.com) をDNSに問いあわせています... 173.194.72.82
mecab.googlecode.com (mecab.googlecode.com)|173.194.72.82|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 63267 (62K) [application/x-gzip]
`mecab-python-0.993.tar.gz' に保存中
100%[======================================>] 63,267 147K/s 時間 0.4s
2015-01-08 06:05:09 (147 KB/s) - `mecab-python-0.993.tar.gz' へ保存完了 [63267/63267]
root@debian:/usr/local# tar zxvf mecab-python-0.993.tar.gz
mecab-python-0.993/
mecab-python-0.993/MeCab.pyc
mecab-python-0.993/LGPL
mecab-python-0.993/BSD
mecab-python-0.993/COPYING
mecab-python-0.993/setup.py
mecab-python-0.993/test.py
mecab-python-0.993/MeCab.py
mecab-python-0.993/GPL
mecab-python-0.993/bindings.html
mecab-python-0.993/README
mecab-python-0.993/MeCab_wrap.cxx
mecab-python-0.993/AUTHORS
root@debian:/usr/local# cd mecab-python-0.993
root@debian:/usr/local/mecab-python-0.993# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying MeCab.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_MeCab' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c MeCab_wrap.cxx -o build/temp.linux-x86_64-2.7/MeCab_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/MeCab_wrap.o -L/usr/local/lib -lmecab -lstdc++ -o build/lib.linux-x86_64-2.7/_MeCab.so
root@debian:/usr/local/mecab-python-0.993# sudo python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/_MeCab.so -> /usr/local/lib/python2.7/dist-packages
copying build/lib.linux-x86_64-2.7/MeCab.py -> /usr/local/lib/python2.7/dist-packages
byte-compiling /usr/local/lib/python2.7/dist-packages/MeCab.py to MeCab.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/mecab_python-0.996.egg-info
●ここからmecab-python試験
root@debian:/usr/local/mecab-python-0.993# python
Python 2.7.3 (default, Jan 2 2013, 13:56:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MeCab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MeCab.py", line 25, in <module>
_MeCab = swig_import_helper()
File "MeCab.py", line 17, in swig_import_helper
import _MeCab
ImportError: libmecab.so.2: cannot open shared object file: No such file or directory
>>> import sys
>>> import MeCab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MeCab.py", line 25, in <module>
_MeCab = swig_import_helper()
File "MeCab.py", line 17, in swig_import_helper
import _MeCab
ImportError: libmecab.so.2: cannot open shared object file: No such file or directory
このOSにはipythonというものがあり、いわゆるインテリセンスがコンソールから使えるのですが、"MeCab"を補完しません。
どうすれば良いのでしょうか
Linux未熟者は手を出さないほうが良かったかも
補足
>>git clone git://github.com/lisa-lab/pylearn2.git Cloning into 'pylearn2'... remote: Counting objects: 37909, done. remote: Total 37909 (delta 0), reused 1 (delta 0) Receiving objects: 100% (37909/37909), 11.17 MiB | 153.00 KiB/s, done. Resolving deltas: 100% (27554/27554), done. Checking connectivity... done. >> python setup.py develop running develop running egg_info creating pylearn2.egg-info writing requirements to pylearn2.egg-info/requires.txt writing pylearn2.egg-info/PKG-INFO writing top-level names to pylearn2.egg-info/top_level.txt writing dependency_links to pylearn2.egg-info/dependency_links.txt writing manifest file 'pylearn2.egg-info/SOURCES.txt' reading manifest file 'pylearn2.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'pylearn2.egg-info/SOURCES.txt' running build_ext building 'pylearn2.utils._window_flip' extension C compiler: gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes creating build creating build/temp.macosx-10.6-intel-2.7 creating build/temp.macosx-10.6-intel-2.7/pylearn2 creating build/temp.macosx-10.6-intel-2.7/pylearn2/utils compile options: '-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c' gcc-4.2: pylearn2/utils/_window_flip.c i686-apple-darwin10-gcc-4.2.1: pylearn2/utils/_window_flip.c: No such file or directory i686-apple-darwin10-gcc-4.2.1: no input files i686-apple-darwin10-gcc-4.2.1: pylearn2/utils/_window_flip.c: No such file or directory i686-apple-darwin10-gcc-4.2.1: no input files lipo: can't figure out the architecture type of: /var/folders/i0/i013vMBRH8O06CgW9BFy3E+++TM/-Tmp-//ccaXhBF6.out i686-apple-darwin10-gcc-4.2.1: pylearn2/utils/_window_flip.c: No such file or directory i686-apple-darwin10-gcc-4.2.1: no input files i686-apple-darwin10-gcc-4.2.1: pylearn2/utils/_window_flip.c: No such file or directory i686-apple-darwin10-gcc-4.2.1: no input files lipo: can't figure out the architecture type of: /var/folders/i0/i013vMBRH8O06CgW9BFy3E+++TM/-Tmp-//ccaXhBF6.out error: Command "gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pylearn2/utils/_window_flip.c -o build/temp.macosx-10.6-intel-2.7/pylearn2/utils/_window_flip.o" failed with exit status 1