简体   繁体   English

MeCab:“ ImportError:DLL加载失败:找不到指定的模块。”

[英]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“

Then it will be OK! 这样就可以了! 在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MeCab:“ImportError:DLL 加载失败:找不到指定的模块。” - MeCab: “ImportError: DLL load failed: The specified module could not be found.” 导入错误:DLL 加载失败:找不到指定的模块。(Keras) - ImportError: DLL load failed: The specified module could not be found.(Keras) ImportError:DLL加载失败:找不到指定的过程。蟒蛇 - ImportError: DLL load failed: The specified procedure could not be found. Python 导入错误:DLL 加载失败:找不到指定的模块。 (手电筒问题) - ImportError: DLL load failed: The specified module could not be found. (Torch issues) python Windows“ ImportError:DLL加载失败:找不到指定的模块。”加载编译的扩展名时 - python Windows “ImportError: DLL load failed: The specified module could not be found.” When loading compiled extension ImportError:DLL加载失败:找不到指定的模块。 在pycharm中导入cv2时 - ImportError: DLL load failed: The specified module could not be found. when importing cv2 in pycharm 导入错误:DLL 加载失败:找不到指定的模块。 Python 3.6 导入 dotnet - ImportError: DLL load failed: The specified module could not be found. Python 3.6 import dotnet 导入错误:DLL 加载失败:找不到指定的模块。 安装成功后 package - ImportError: DLL load failed: The specified module could not be found. After successfully installing the package ImportError:DLL加载失败:找不到指定的模块。 CV2 - ImportError: DLL load failed: The specified module could not be found. cv2 ImportError:DLL加载失败:找不到指定的模块。 “matplotlib.pyplot” - ImportError: DLL load failed: The specified module could not be found. “matplotlib.pyplot”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM