% curl -OL https://github.com/taku910/cabocha/archive/master.zip
% unzip master.zip
% cd cabocha-master
% pip install python/
/Users/hurui05/anaconda3/bin/python3.10 /Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py
Traceback (most recent call last):
File "/Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py", line 781, in <module>
run_cabocha_demo()
File "/Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py", line 749, in run_cabocha_demo
import CaboCha
File "/Users/hurui05/anaconda3/lib/python3.10/site-packages/CaboCha.py", line 28, in <module>
_CaboCha = swig_import_helper()
File "/Users/hurui05/anaconda3/lib/python3.10/site-packages/CaboCha.py", line 24, in swig_import_helper
_mod = imp.load_module('_CaboCha', fp, pathname, description)
File "/Users/hurui05/anaconda3/lib/python3.10/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Users/hurui05/anaconda3/lib/python3.10/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN7CaboCha12createParserEPKc'
/Users/hurui05/anaconda3/bin/python3.10 /Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py
Traceback (most recent call last):
File "/Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py", line 781, in <module>
run_cabocha_demo()
File "/Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py", line 749, in run_cabocha_demo
import CaboCha
File "/Users/hurui05/anaconda3/lib/python3.10/site-packages/CaboCha.py", line 28, in <module>
_CaboCha = swig_import_helper()
File "/Users/hurui05/anaconda3/lib/python3.10/site-packages/CaboCha.py", line 24, in swig_import_helper
_mod = imp.load_module('_CaboCha', fp, pathname, description)
File "/Users/hurui05/anaconda3/lib/python3.10/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Users/hurui05/anaconda3/lib/python3.10/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN7CaboCha12createParserEPKc'
以下のページで似たような問題が記述されていましたが、解決方法は私の場合には役に立たないみたいです。助けてください!
macでmecab-python3のimport error(Symbol not found)を解決
% otool -L /Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so
/Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so:
/usr/local/lib/libcrfpp.0.dylib (compatibility version 1.0.0, current version 1.0.0)
@rpath/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
% ls /opt/homebrew/lib
libcrfpp.0.dylib libcrfpp.dylib libgmp.a libgmpxx.4.dylib libgmpxx.dylib
libcrfpp.a libgmp.10.dylib libgmp.dylib libgmpxx.a pkgconfig
install_tool_name -change
を使ってみると、
% install_name_tool -change "/usr/local/lib/libcrfpp.0.dylib" /opt/homebrew/lib/libcrfpp.0.dylib /Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so
% otool -L /Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so
/Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so:
/opt/homebrew/lib/libcrfpp.0.dylib (compatibility version 1.0.0, current version 1.0.0)
@rpath/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
結局同じエラーが出てきました。
/Users/hurui05/anaconda3/bin/python3.10 /Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py
Traceback (most recent call last):
File "/Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py", line 781, in <module>
run_cabocha_demo()
File "/Users/hurui05/Desktop/mecab/frontend/src/cleaners/pseudo_cleaner.py", line 749, in run_cabocha_demo
import CaboCha
File "/Users/hurui05/anaconda3/lib/python3.10/site-packages/CaboCha.py", line 28, in <module>
_CaboCha = swig_import_helper()
File "/Users/hurui05/anaconda3/lib/python3.10/site-packages/CaboCha.py", line 24, in swig_import_helper
_mod = imp.load_module('_CaboCha', fp, pathname, description)
File "/Users/hurui05/anaconda3/lib/python3.10/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Users/hurui05/anaconda3/lib/python3.10/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Users/hurui05/anaconda3/lib/python3.10/site-packages/_CaboCha.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN7CaboCha12createParserEPKc'
助けてください!