How to install pyhyphen on Mac OS X

27 views
Skip to first unread message

Peng Yu

unread,
Sep 17, 2016, 11:35:22 AM9/17/16
to pyhyphen
Hi,

I try to install pyhyphen. But the config.py file is not created correctly with the variables like default_repository set. Does anybody know what is the correct way to install pyhyphen?

$ pip install  pyhyphen
Collecting pyhyphen
Installing collected packages: pyhyphen
Successfully installed pyhyphen-2.0.5
$ cat /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen/config.py
# This file contains default config info for downloading and installing dictionaries
# The template placeholders are filled by setup.py.



# Local path for dictionaries
default_dict_path = r'$path'

# path for the metadata file
default_dict_info_path = ur'$path'

# URL of the repository for dictionaries
default_repository = u'$repo'

# Country and language codes: These will be appended to the default_repos path
languages = set(('af_ZA', 'an_ES', 'ar', 'be_BY', 'bg_BG',
'bn_BD', 'br_FR', 'ca', 'cs_CZ', 'da_DK', 'de',
'el_GR', 'en', 'es_ES', 'et_EE', 'fr_FR', 'gd_GB', 'gl',
'gu_IN', 'he_IL', 'hi_IN', 'hr_HR', 'hu_HU', 'it_IT', 'ku_TR',
'lt_LT', 'lv_LV', 'ne_NP', 'nl_NL', 'no', 'oc_FR', 'pl_PL',
'prj', 'pt_BR', 'pt_PT', 'ro', 'ru_RU', 'si_LK', 'sk_SK',
'sl_SI', 'sr', 'sv_SE', 'sw_TZ',
'te_IN', 'th_TH', 'uk_UA', 'zu_ZA'))

Regards,
Peng

Dr. Leo

unread,
Sep 17, 2016, 3:06:05 PM9/17/16
to pyhy...@googlegroups.com
I cannot replicate this error as I don't work on Mac. You could try downloading from pypi then typing "python setup.py install".

Alternatively, fix config.py manually: The path variables in config.py should contain the package roor dir in most cases. You could fix this manually.

Leo
--
You received this message because you are subscribed to the Google Groups "pyhyphen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyhyphen+u...@googlegroups.com.
To post to this group, send email to pyhy...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyhyphen.
For more options, visit https://groups.google.com/d/optout.

Peng Yu

unread,
Sep 19, 2016, 3:22:11 PM9/19/16
to pyhyphen


On Saturday, September 17, 2016 at 2:06:05 PM UTC-5, Dr. Leo wrote:
I cannot replicate this error as I don't work on Mac. You could try downloading from pypi then typing "python setup.py install".

Alternatively, fix config.py manually: The path variables in config.py should contain the package roor dir in most cases. You could fix this manually.


Here is the output when I try `python setup.py install`. It still does not work.

How to set these variables in config.py manually? Do you have any example?

/tmp/pyhyphen-2.0.5$ python setup.py install
running install
running build
running build_py
copying textwrap2.py -> build/lib.macosx-10.6-intel-2.7
copying hyphen/__init__.py -> build/lib.macosx-10.6-intel-2.7/hyphen
copying hyphen/config.py -> build/lib.macosx-10.6-intel-2.7/hyphen
copying hyphen/dictools.py -> build/lib.macosx-10.6-intel-2.7/hyphen
running build_ext
building 'hyphen.hnj' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Iinclude -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/hnjmodule.c -o build/temp.macosx-10.6-intel-2.7/src/hnjmodule.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Iinclude -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/hyphen.c -o build/temp.macosx-10.6-intel-2.7/src/hyphen.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Iinclude -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/hnjalloc.c -o build/temp.macosx-10.6-intel-2.7/src/hnjalloc.o
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/hnjmodule.o build/temp.macosx-10.6-intel-2.7/src/hyphen.o build/temp.macosx-10.6-intel-2.7/src/hnjalloc.o -o build/lib.macosx-10.6-intel-2.7/hyphen/hnj.so
running install_lib
copying build/lib.macosx-10.6-intel-2.7/hyphen/__init__.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen
copying build/lib.macosx-10.6-intel-2.7/hyphen/config.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen
copying build/lib.macosx-10.6-intel-2.7/hyphen/dictools.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen
copying build/lib.macosx-10.6-intel-2.7/hyphen/hnj.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen
copying build/lib.macosx-10.6-intel-2.7/textwrap2.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen/__init__.py to __init__.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen/config.py to config.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hyphen/dictools.py to dictools.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/textwrap2.py to textwrap2.pyc
running install_egg_info
Removing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyHyphen-2.0.5-py2.7.egg-info
Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyHyphen-2.0.5-py2.7.egg-info
Adjusting /.../hyphen/config.py...
Done.
Installing dictionaries... en_US ...
/tmp/pyhyphen-2.0.5$ find.sh -n config.py
./2.x/config.py
./build/lib.macosx-10.6-intel-2.7/hyphen/config.py
/tmp/pyhyphen-2.0.5$ cat $(find.sh -n config.py)
/tmp/pyhyphen-2.0.5$
 

Dr. Leo

unread,
Sep 19, 2016, 5:04:11 PM9/19/16
to pyhy...@googlegroups.com
It looks like it has been properly installed:
 
Adjusting /.../hyphen/config.py...
Done.

However, the config file has only been adjusted in the site-packages dir, not in the dir where you unpacked the tarball for install. So try cd .. so as to import it from site-packages.

Pls let me know if this helps.
Reply all
Reply to author
Forward
0 new messages