質問

PyEnchant included in site-packages.zip in bundle, but it cant load any dict! Why not? I always get "dict not found" error. but dictionaries are in site-packages.zip/enchant/share/enchant/myspell/.. What is going on?

    2012-03-01 14:24:42,469     EXCEPTION:
    2012-03-01 14:24:42,469         EXCEPTION TYPE: <class 'enchant.errors.DictNotFoundError'> EXCEPTION VALUE: Dictionary for language 'ru_RU' could not be found
    2012-03-01 14:24:42,469              TRACEBACK: ('/Users/dima/dev/up/up/consultant/client/dist/main.app/Contents/Resources/__boot__.py', 39, '<module>', None)
    2012-03-01 14:24:42,469              TRACEBACK: ('/Users/dima/dev/up/up/consultant/client/dist/main.app/Contents/Resources/__boot__.py', 36, '_run', None)
    2012-03-01 14:24:42,469              TRACEBACK: ('/Users/dima/dev/up/up/consultant/client/dist/main.app/Contents/Resources/main.py', 26, '<module>', None)
    2012-03-01 14:24:42,469              TRACEBACK: ('spell_check_text_edit.pyc', 21, '__init__', None)
    2012-03-01 14:24:42,470              TRACEBACK: ('enchant/__init__.pyc', 502, '__init__', None)
    2012-03-01 14:24:42,470              TRACEBACK: ('enchant/__init__.pyc', 264, '_request_dict_data', None)
    2012-03-01 14:24:42,470              TRACEBACK: ('enchant/__init__.pyc', 218, '_raise_error', None)
役に立ちましたか?

解決

Did you tried to install Aspell and dictionary from ftp://ftp.gnu.org/gnu/aspell/dict/0index.html?
To install dict simply download ftp://ftp.gnu.org/gnu/aspell/dict/ru/aspell6-ru-0.99f7-1.tar.bz2, untar it and

./configure && make && make install

他のヒント

pyEnchant won't work when it is a zip file, try:

$ python setup.py py2app --packages=enchant

This will tell py2app to include the enchant package outside of the site-packages.zip.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top