我可以使用pip install pyenchantbrew install enchant安装pyenchant。但是,当我去进口附魔,我得到以下错误:

>>> import enchant
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import enchant
  File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/enchant/__init__.py", line 92, in <module>
    from enchant import _enchant as _e
  File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/enchant/_enchant.py", line 121, in <module>
    prefix_dir.contents = c_char_p(e_dir)
TypeError: bytes or integer address expected instead of str instance

最佳答案

在另一篇文章(Pyenchant utils loading error)中,他们建议在MacOS中安装带有自制程序(brew install enchant)的C库,对我来说,这是可行的。

关于python - 在Python 3中导入Pyenchant时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30249856/

10-15 23:35