Dictionary search path on windows

55 views
Skip to first unread message

Sandro Mani

unread,
Oct 6, 2010, 11:45:11 AM10/6/10
to pyenchant users
Hello,
I use pyenchant to list the dictionaries available to pygtkspell,
since pygtkspell does not provide such functionality. On linux,
everything is fine, since the dictionary search paths of enchant
library and pyenchant are the same. Unfortunately this is not the case
on windows: the enchant dll compiled with default settings (and hence
pygtkspell) search for dictionaries in ...\gtktree\share\myspell
\dicts, while pyenchant bundles everything it needs into it's local
site-packages directory, including the dictionaries. This causes the
dictionaries found by pyenchant to differ from those found by
pygtkspell. From the source I couldn't figure out where the dictionary
search path is set, removing the whole windows specific block in
setup.py did prevent the bdist_wininst from bundling everything, but
the dictionary search path is not the same as the one of the enchant
dll. How can I make these paths match? I could not find anything
obvious in the source code. Thanks!
Regards,
Sandro Mani

Ryan Kelly

unread,
Oct 7, 2010, 6:02:31 PM10/7/10
to pyencha...@googlegroups.com


To get the same search path, you need to make sure pyenchant is loading
the same enchant dll as the other applications on your system.
PyEnchant itself does not play any tricks with the dictionary search
path, it's all up to the underlying dll.

Try setting the environment variable "PYENCHANT_LIBRARY_PATH" to point
to the system-wide enchant dll.

If that doesn't work out for some reason, you can trying changing the
dll-finding logic at the start of enchant/_enchant.py.


Hope that helps!


Ryan


--
Ryan Kelly
http://www.rfk.id.au | This message is digitally signed. Please visit
ry...@rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details

signature.asc

Sandro Mani

unread,
Oct 8, 2010, 5:55:55 AM10/8/10
to pyencha...@googlegroups.com

Thanks for you reply. I managed to solve my problem by using
enchant.set_param("enchant.myspell.dictionary.path", dictpath),
now everything works fine!
Regards,
Sandro Mani

Reply all
Reply to author
Forward
0 new messages