EC2 Enchant 无法找到字典 en_US
我在运行命令 d = enchant.Dict('en_US')
时遇到了一个错误,错误信息是 "enchant.errors.DictNotFoundError: 找不到语言'en_US'的词典"
。
我已经运行了命令 sudo yum install aspell -en
,并尝试设置参数路径 "enchant.set_param("enchant.aspell.dictionary.path","/usr/lib64/aspell-0.60")"
,但还是没有解决问题。
有什么建议吗?
1 个回答
7
我需要先运行 yum install aspell-en enchant-aspell
才能让它正常工作。注意“aspell-en”中间没有空格。
enchant-aspell 是一个可以让 enchant 和 aspell 互相沟通的工具,它包含了“与 aspell 的集成”,这样它们就能一起工作了。希望这对你有帮助。