I was having difficulties installing PyICU on macOS.
Normally, most packages I need can be installed by
pip install <package_name>
without any troubles or even better, sometimes they come with Anaconda.
Sadly, I can’t do that with PyICU and Anaconda.
- http://python3.wannaphong.com/2015/03/python_9.html (Thai)
- https://naiwaen.debuggingsoft.com/2017/11/install-python-pyicu-anaconda/ (Thai)
I followed the last link and got PyICU installed successfully.
I also tried to install it with Anaconda and here are the steps to install PyICU on macOS with Anaconda.
If you can’t install with Anaconda, just follow the GitHub link above.
$ brew install icu4c
You will see the caveat like this:
==> Caveats This formula is keg-only, which means it was not symlinked into /usr/local, because macOS provides libicucore.dylib (but nothing else). If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/icu4c/lib CPPFLAGS: -I/usr/local/opt/icu4c/include For pkg-config to find this software you may need to set: PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig
# Download PyICU-1.9.8.tar.gz from https://pypi.python.org/pypi/PyICU/ $ tar xvf PyICU-1.9.8.tar.gz $ cd PyICU-1.9.8 $ LDFLAGS=-L/usr/local/opt/icu4c/lib CPPFLAGS=-I/usr/local/opt/icu4c/include python setup.py build $ python setup.py install
- macOS Sierra 10.12.6
- Python 3.6.1 :: Anaconda custom (x86_64)