Сначала я установил icu4c
по формуле Homebrew:
$ brew install icu4c
$ ls /usr/local/Cellar/icu4c/
64.2
, затем установите соответствующие флаги:
export ICU_VERSION=64
export PYICU_INCLUDES=/usr/local/Cellar/icu4c/64.2/include
export PYICU_LFLAGS=-L/usr/local/Cellar/icu4c/64.2/lib
, а затем установите PyIcu из pip
:
$ pip install pyicu
Successfully installed pyicu-2.3.1
но при импорте: python -c "import icu"
я получаю ошибку
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/icu/__init__.py", line 37, in <module>
from _icu import *
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/_icu.so, 2): Symbol not found: __ZN6icu_638ByteSink15GetAppendBufferEiiPciPi
Referenced from: /usr/local/lib/python2.7/site-packages/_icu.so
Expected in: flat namespace
in /usr/local/lib/python2.7/site-packages/_icu.so