在Python 3中导入Pyenchant时出错
我能够使用在Python 3中导入Pyenchant时出错,python,python-3.x,pyenchant,Python,Python 3.x,Pyenchant,我能够使用pip install pyenchant和brew install enchant安装pyenchant。但是,当我转到导入enchant时,会出现以下错误: >>> import enchant Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> import enchant File "/usr/local/Cellar/py
pip install pyenchant
和brew install enchant
安装pyenchant。但是,当我转到导入enchant时,会出现以下错误:
>>> 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
>导入附魔
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
进口附魔
文件“/usr/local/cillar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site packages/enchant/__init__;.py”,第92行
从“enchant import”\u enchant as\u e
文件“/usr/local/ceral/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site packages/enchant/_enchant.py”,第121行
前缀_dir.contents=c_char_p(e_dir)
TypeError:需要字节或整数地址,而不是str实例
在另一篇帖子()中,他们建议在MacOS中用自制软件安装C库(brew安装enchant),对我来说,它起了作用。在python 3中,64位enchant不存在它是一个老问题,不知道为什么不解决它,如果它绝对需要使用python 32位,那么它将解决它,它工作正常。我无法在Linux上复制它(恐怕无法在OS X上测试)。如果我冒昧猜测一下,我会说pyenchant的安装没有针对enchant正确编译/链接。我尝试过卸载,并在pyenchant之前重新安装enchant,但没有luckI在Mac上使用pip3 install pyenchant
安装pyenchant时收到相同的错误。我在Mac上收到相同的错误。