Python 3 import error

I was able to install pyenchant using pip install pyenchant

and brew install enchant

. However, when I go to import, I get the following error:

>>> 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

      

+3


source to share


1 answer


In this other post ( Pyenchant file download error ), they suggested installing C library on macOS using homebrew (brew install enchant), it worked for me.



0


source







All Articles