pip安装icu失败:Command "python setup.py egg_info" failed with error code 1 in
2017-01-16 14:20
1041 查看
问题
Mac 下通过 pip 安装 icu 失败。解决办法及原因
问题的原因是因为icu库中的某一行代码找不到一个文件,获取不到ICU_VERSION的值。
# 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
参考
Error installing pip pyicu相关文章推荐
- python读取excel导入word表格
- re-正则表达式模块
- python处理文件首行读取问题 utf-8 BOM
- 用PythonPi实现门禁系统-功能实现
- python 使用selenium+urllib爬取淘宝MM照片
- python题目-----Python里面如何拷贝一个对象?
- Python性能优化的20条建议
- python连接mysql
- python 爬照片 模拟浏览器 先登录账号
- Python3基础 frozenset 不可更改的集合
- Python3基础 set add 向集合中加入新的元素
- Python3基础 list 使用for循环 删除列表中的重复项
- python基础学习笔记(个人学习时记录的笔记,不全的地方请大家指正)
- Python3基础 set 删除列表中的重复项
- Python3基础 set 自动将重复合并掉 不支持索引
- Python3基础 dict setdefault 根据键查找值,找不到键会添加
- Python3基础 dict pop 弹出指定键的项
- Python3基础 dict id 查询变量的存储位置
- Python3基础 dic clear 清空一个字典
- Python3基础 dic in/not in 查询一个字符是否指定字典的键或者值