Unable to install pyenchant-1.6.5 for python 2.7 on Mac OSX Lion

不想你离开。 提交于 2020-01-05 02:52:06

问题


I am not able to install pyenchant for python 2.7 on my Max OSX Lion. I get an error using the dmg installer. I get an error stating that /opt/local/Library/Frameworks Python 2.7 is required.

My python 2.7 is installed in /Library/Frameworks


回答1:


That installer you are using is expecting there to be a macports version of python installed ( the /opt location ).

Just try installing it via easy_install or pip

easy_install pyenchant

Or

pip install pyenchant



回答2:


I was able to install pyenchant on Mac OS X Maverick using non-Homebrew Python by using this procedure. It is likely to work for Mac OS X Mountain Lion as well.

The pyenchant Python library has four prerequisites: gettext, glib, libiconv, and enchant.

Install the first two using Homebrew: brew install gettext and brew install glib

Install the second two using the source code, or using the source from the pyenchant-bdist-osx-source tarball (https://github.com/downloads/rfk/pyenchant/pyenchant-bdist-osx-sources-1.6.5.tar.gz):

tar xzf libiconv-1.3.1.tar.gz
cd libiconv-1.31.1
./configure
make
make install
cd ..

and

tar xzf enchant-1.6.0.tar.gz
cd enchant-1.6.0
./configure
make
make install
cd ..

Now you've got all the prerequisites, so you can install pyenchant directly using setuptools. Download the source tarball (http://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz) and extract it. Now use setup.py to build and install pyenchant:

tar xzf pyenchant-1.6.5.tar.gz
cd pyenchant-1.6.5
python setup.py build
python setup.py install
cd ..

And you should be all finished!



来源:https://stackoverflow.com/questions/11236332/unable-to-install-pyenchant-1-6-5-for-python-2-7-on-mac-osx-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!