libicu-dev (PyICU dependency)
brew uninstall --ignore-dependencies icu4c
brew install pkg-config icu4c # keg-only
PyICU (pypostal dependency)
pip uninstall pyicu
export PATH="/usr/local/opt/icu4c/bin:/usr/local/opt/icu4c/sbin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig"
# ensure system clang is used for proper libstdc++ https://github.com/ovalhub/pyicu/issues/5#issuecomment-291631507
unset CC CXX
pip install --no-binary=:pyicu: pyicu # avoid wheels from previous runs or PyPI
libpostal (pypostal dependency)
One-liner (using HEAD as v1.1 was released in 2018):
brew install --HEAD robsalasco/libpostal/libpostal
Or manually:
brew install curl autoconf automake libtool pkg-config gcc@8
export CC="/usr/local/bin/gcc-8"
alias gcc="gcc-8"
git clone https://github.com/openvenues/libpostal.git
cd libpostal
./bootstrap.sh
./configure --datadir="${HOME}/.libpostal"
make -j4
sudo make install
pip install postal
# test installation by parsing an example address
python -c "from postal.parser import parse_address; my_address = '123 Beech Lake Ct. Roswell, GA 30076'; print({v: k for k, v in dict(parse_address(my_address)).items()})"
# {'house_number': '123', 'road': 'beech lake ct.', 'city': 'roswell', 'state': 'ga', 'postcode': '30076'}
Hey @andilabs
I have seen this error before during initial installation, and I'm not 100% sure what causes/solves this issue on MacOS. But after repeated trial & error I managed to get it to work by starting from scratch and I haven't touched the installation since.
There is probably some conflict with the system-installed ICU or some issue with (possibly multiple)
icu-config
alias(es) on your system (see this comment by the PyICU dev: ovalhub/pyicu#112 (comment)).Please let me know if you solve this issue, and what solved it. We can adapt the instructions to help others with this strange issue.
For what it's worth, I'm using
gcc@8
as system wide default C++ compiler as opposed to the defaultclang
.