[英]MeCab: “ImportError: DLL load failed: The specified module could not be found.”
This is the first time to use python. 这是第一次使用python。
I installed MeCab through "mecab_python_windows-0.9.9.6-cp27-cp27m-win32.whl" 我通过“ mecab_python_windows-0.9.9.6-cp27-cp27m-win32.whl”安装了MeCab
Then I used this 然后我用这个
import MeCab
test = "今日はいい天気ですね。遊びに行かない?新宿で祭りがある!"
mt = MeCab.Tagger("-d C:\Program Files (x86)\MeCab\dic\ipadic")
print(mt.parse(test))
and got this error 并得到这个错误
Traceback (most recent call last):
File "C:/Users/Admin/PycharmProjects/mecab/main.py", line 1, in <module>
import MeCab
File "D:\Python\lib\site-packages\MeCab.py", line 21, in <module>
_MeCab = swig_import_helper()
File "D:\Python\lib\site-packages\MeCab.py", line 20, in
swig_import_helper
return importlib.import_module('_MeCab')
File "D:\Python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
How can I fix it? 我该如何解决?
First,you should install mecab-0.996.exe. 首先,您应该安装mecab-0.996.exe。 Second,copy this file "E:\\Anaconda3\\Lib\\site-packages\\Python36\\Lib\\site-packages\\libmecab.dll" to "C:\\Windows\\System32" or copy this file "E:\\Anaconda3\\Lib\\site-packages\\Python36\\Lib\\site-packages\\libmecab.dll" to "E:\\Anaconda3\\Lib\\site-packages" 其次,将此文件“ E:\\ Anaconda3 \\ Lib \\ site-packages \\ Python36 \\ Lib \\ site-packages \\ libmecab.dll”复制到“ C:\\ Windows \\ System32”,或复制此文件“ E:\\ Anaconda3 \\ Lib \\ site-packages \\ Python36 \\ Lib \\ site-packages \\ libmecab.dll“到” E:\\ Anaconda3 \\ Lib \\ site-packages“
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.