我一直试图在我的mac上安装musicbrainz服务器,有一步我必须安装pyicu。我一直在犯这个错误:
Collecting pyicu
Downloading PyICU-1.9.5.tar.gz (181kB)
100% |████████████████████████████████| 184kB 515kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-E50o2C/pyicu/setup.py", line 11, in <module>
ICU_VERSION = subprocess.check_output(('icu-config', '--version')).strip()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-E50o2C/pyicu/我试过下载ez_setup.py并做python ez_setup.py。我已经升级了setuptools,并分别下载了这些工具。我不知道还有什么可以尝试的。请帮帮我!
发布于 2016-12-22 11:12:23
当我试图安装polyglot时,我在我的mac上遇到了这个问题(polyglot需要pyicu)。下面为我解决了这个问题。
# 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.1'
# 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/{version, e.g. 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发布于 2017-01-20 14:34:56
我在ubuntu 14.04和16.04上遇到了这个问题。若要解决此问题,请安装libicu-dev,然后再尝试安装。我做到了
$sudo apt install libicu-dev
$pip install pyicu发布于 2018-02-22 11:43:22
对我来说是可行的:
1)用brew安装icu4c:
brew install icu4c
brew link icu4c --force2)检查版本:
ls /usr/local/Cellar/icu4c/它提示如下:64.2
3)执行以下命令,并从前一步替换正确的版本(第一行只有整数部分,第二行和第三行用十进制部分):
export ICU_VERSION=64
export PYICU_INCLUDES=/usr/local/Cellar/icu4c/64.2/include
export PYICU_LFLAGS=-L/usr/local/Cellar/icu4c/64.2/lib4)最后为pyicu安装python包:
pip install pyicu --upgrade如果上面的操作失败(在OS X10.15上已经发生在我身上),您可能需要:
brew install pkg-config
export PYICU_CFLAGS=-std=c++11:-DPYICU_VER='"2.3.1"'https://stackoverflow.com/questions/40940188
复制相似问题