problem
Failed to install icu via pip under Mac.
Solution and reason
The cause of the problem is that a certain line of code in the icu library cannot find a file and cannot get ICU_VERSION
the value.
# Install icu
brew install icu4c
# check newest version
ls /usr/local/Cellar/icu4c/
# Edit pyicu installer to work
git clone https://github.com/ovalhub/pyicu.git
# edit setup.py not to query for the version, i.e. change
# ICU_VERSION = subprocess.check_output(('icu-config', '--version')).strip()
# to whatever your version is, e.g.
# ICU_VERSION = '57'
# Install pyicu
env LDFLAGS=-L/usr/local/opt/icu4c/lib CPPFLAGS=-I/usr/local/opt/icu4c/include DYLD_LIBRARY_PATH=-L/usr/local/opt/icu4c/lib python setup.py build
env LDFLAGS=-L/usr/local/opt/icu4c/lib CPPFLAGS=-I/usr/local/opt/icu4c/include DYLD_LIBRARY_PATH=-L/usr/local/opt/icu4c/lib sudo python setup.py install
# Change DYLD_LIBRARY_PATH (not sure if req'd)
DYLD_LIBRARY_PATH=/usr/local/Cellar/icu4c/57.1/:$DYLD_LIBRARY_PATH
echo $DYLD_LIBRARY_PATH
# Icu works now from python, and you can proceed with polyglot
$ python
>>> import icu
$ pip install polyglot
$ python
>>> import polyglot
reference
Read More:
- [Solved] python Connect hive to Install sasl Error: Building wheel for sasl (setup.py) … error
- Centos pip install uwsgi error: “fatal error: Python.h: No such file or directory”
- [Solved] Virtualenv virtual environment error: setuptools pip wheel failed with error code 1
- [Solved] Mac M1 Brew install Error: Command failed with exit 128:git
- [Solved] IOS Error: Command MergeSwiftModule failed with a nonzero exit code
- Bin File Programming Failed, could not find core in coresight setup, erase error
- [Solved] no identity found – Command CodeSign failed with a nonzero exit code
- M1 MacBook cannot use pip to install pandas [How to Solve]
- [Solved] ERROR command failed: npm install –loglevel error –legacy-peer-deps
- [Solved] INSTALL_FAILED_DEXOPT (DEX optimization verification failed)
- [Solved] pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
- Vue Error: command failed: npm install –loglevel error –registry=https://registry.npm.taobao.org
- [Solved] fatal: not in a git directory Error: Command failed with exit 128: git
- [Solved] Installation failed due to: ‘INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Package com.
- [Solved] Android Studio APK install Error: INSTALL_FAILED_CONFLICTING_PROVIDER
- [Solved] C# Access Mongodb Database Error: command find failed: Command find requires authentication
- [Solved] Vcpkg Install Building package brotli:x64-windows failed with: BUILD_FAILED Locking applocal.ps1
- flask init-db Error: Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory.
- Error while trying to run project:unable to start debugging.the debugger is not properly installed. run setup to install or repa
- [Solved] Android-android studio apk Install Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED