Pyenchant utils loading error

三世轮回 提交于 2019-12-08 06:40:00

问题


I am trying to load pyenchant for some text processing, but after using pip install pyenchant when I attempt to import pyenchant I get the following error. Has anyone seen this before or know how to solve it?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-6-fd4a8a7f6802> in <module>()
  1 import pandas as pd
----> 2 import enchant as ench
  3 
  4 List_v1 = pd.read_csv("List_v1.txt",sep='\t')
  5 List_v1 = List_v1.fillna(0)

/__init__.py in         <module>()
 90 
 91 try:
---> 92     from enchant import _enchant as _e
 93 except ImportError:
 94     if not os.environ.get("PYENCHANT_IGNORE_MISSING_LIB",False):

/enchant/_enchant.py in <module>()
 53 from ctypes.util import find_library
 54 
---> 55 from enchant import utils
 56 from enchant.errors import *
 57 from enchant.utils import unicode

ImportError: cannot import name utils

回答1:


I had the same error. What solved my problem was to install the C library enchant which pyenchant is based off of. (See Cannot install pyenchant on OSX) You can install it by running:

brew install enchant


来源:https://stackoverflow.com/questions/32053106/pyenchant-utils-loading-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!