简体   繁体   中英

pyenchant installation on OS X Yosemite

I am trying to install pyenchant on Mac OS X Yosemite. It works fine on linux machines but not in mac, I am having the following error:

ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI.

This is how I installed the package:

pip install pyenchant

and next, I import it in this way:

import enchant

I am using Python 3.4.

Enchant is a C library, and pyenchant provides Python bindings to that library. For your code to work, you need to install Enchant as well. If you're using homebrew, you can use:

>>brew install enchant

After installing Enchant, you can then install Pyenchant:

>>pip install pyenchant

I hope this helps.

Also, make sure your Xcode is updated . If it is not updated, you will get an error when running the brew installer:
configure: error: cannot run C compiled programs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM