Closed schen57 closed 5 years ago
Ok, this part is installed correctly:
'''git clone https://github.com/openvenues/libpostal cd libpostal ./bootstrap.sh ./configure --datadir=[...some dir with a few GB of space...] make sudo make install'''
but when I tried pip install postal, I am getting the errors below:
'Failed building wheel for postal'
and
'''1 error generated. error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/19/1pcpc2r57_g6gjl_2v5_4kgc0000gn/T/pip-install-d2gfz7kd/postal/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/19/1pcpc2r57_g6gjl_2v5_4kgc0000gn/T/pip-record-6mt9jy9d/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/19/1pcpc2r57_g6gjl_2v5_4kgc0000gn/T/pip-install-d2gfz7kd/postal/ '''
So I was following the installation instruction step by step in the terminal. I first copied the following command
brew install curl autoconf automake libtool pkg-config
it took some time and then I just copied the following block directly `git clone https://github.com/openvenues/libpostal cd libpostal ./bootstrap.sh ./configure --datadir=[...some dir with a few GB of space...] make sudo make installOn Linux it's probably a good idea to run
sudo ldconfig`
and I am getting the following issues on the terminal:
glibtoolize: putting auxiliary files in '.'. glibtoolize: copying file './ltmain.sh' glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. glibtoolize: copying file 'm4/libtool.m4' glibtoolize: copying file 'm4/ltoptions.m4' glibtoolize: copying file 'm4/ltsugar.m4' glibtoolize: copying file 'm4/ltversion.m4' glibtoolize: copying file 'm4/lt~obsolete.m4' glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am. ./bootstrap.shconfigure.ac:14: installing './compile' configure.ac:14: installing './config.guess' configure.ac:14: installing './config.sub' configure.ac:12: installing './install-sh' configure.ac:12: installing './missing' src/Makefile.am: installing './depcomp' parallel-tests: installing './test-driver' (base) Shengyus-MacBook-Pro-2:libpostal shengyuchen$ ./bootstrap.sh glibtoolize: putting auxiliary files in '.'. glibtoolize: copying file './ltmain.sh' glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. glibtoolize: copying file 'm4/libtool.m4' glibtoolize: copying file 'm4/ltoptions.m4' glibtoolize: copying file 'm4/ltsugar.m4' glibtoolize: copying file 'm4/ltversion.m4' glibtoolize: copying file 'm4/lt~obsolete.m4' glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am. configure.ac:14: installing './compile' configure.ac:12: installing './missing' src/Makefile.am: installing './depcomp' (base) Shengyus-MacBook-Pro-2:libpostal shengyuchen$ make make: *** No targets specified and no makefile found. Stop. (base) Shengyus-MacBook-Pro-2:libpostal shengyuchen$ sudo make install Password: make: *** No rule to make target
install'. Stop. (base) Shengyus-MacBook-Pro-2:libpostal shengyuchen$ pip install postal Collecting postal Using cached https://files.pythonhosted.org/packages/3d/0b/2f077c14165c0e4ed795c3fa83e1b68d357186da42ee3ab5d64b77424f12/postal-1.1.7.tar.gz Requirement already satisfied: six in /anaconda3/lib/python3.6/site-packages (from postal) (1.12.0) Building wheels for collected packages: postal Running setup.py bdist_wheel for postal ... error Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/19/1pcpc2r57_g6gjl_2v54kgc0000gn/T/pip-install-7a1n45t/postal/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /private/var/folders/19/1pcpc2r57_g6gjl_2v5_4kgc0000gn/T/pip-wheel-bxkeetgi --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 creating build/lib.macosx-10.7-x86_64-3.6/postal copying postal/token_types.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/dedupe.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/normalize.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/init.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/parser.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/near_dupe.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/tokenize.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/expand.py -> build/lib.macosx-10.7-x86_64-3.6/postal creating build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/test_parser.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/init.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/test_expand.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/test_near_dupes.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests creating build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/encoding.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/init.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/omitted.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/enum.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/pyutils.h -> build/lib.macosx-10.7-x86_64-3.6/postal running build_ext building 'postal._expand' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/postal gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/usr/local/include -I/anaconda3/include/python3.6m -c postal/pyexpand.c -o build/temp.macosx-10.7-x86_64-3.6/postal/pyexpand.o -std=c99 postal/pyexpand.c:2:10: fatal error: 'libpostal/libpostal.h' file not foundinclude <libpostal/libpostal.h>
1 error generated. error: command 'gcc' failed with exit status 1
Failed building wheel for postal Running setup.py clean for postal Failed to build postal Installing collected packages: postal Running setup.py install for postal ... error Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/19/1pcpc2r57_g6gjl_2v54kgc0000gn/T/pip-install-7a1n45t/postal/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/19/1pcpc2r57_g6gjl_2v5_4kgc0000gn/T/pip-record-fu7tijzh/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 creating build/lib.macosx-10.7-x86_64-3.6/postal copying postal/token_types.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/dedupe.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/normalize.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/init.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/parser.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/near_dupe.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/tokenize.py -> build/lib.macosx-10.7-x86_64-3.6/postal copying postal/expand.py -> build/lib.macosx-10.7-x86_64-3.6/postal creating build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/test_parser.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/init.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/test_expand.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests copying postal/tests/test_near_dupes.py -> build/lib.macosx-10.7-x86_64-3.6/postal/tests creating build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/encoding.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/init.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/omitted.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/utils/enum.py -> build/lib.macosx-10.7-x86_64-3.6/postal/utils copying postal/pyutils.h -> build/lib.macosx-10.7-x86_64-3.6/postal running build_ext building 'postal._expand' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/postal gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/usr/local/include -I/anaconda3/include/python3.6m -c postal/pyexpand.c -o build/temp.macosx-10.7-x86_64-3.6/postal/pyexpand.o -std=c99 postal/pyexpand.c:2:10: fatal error: 'libpostal/libpostal.h' file not found
include <libpostal/libpostal.h>
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/19/1pcpc2r57_g6gjl_2v54kgc0000gn/T/pip-install-7a1n45t/postal/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/19/1pcpc2r57_g6gjl_2v5_4kgc0000gn/T/pip-record-fu7tijzh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/19/1pcpc2r57_g6gjl_2v54kgc0000gn/T/pip-install-7a1n45t/postal/ `
Please help.... I need this package to parse some address fields ......