首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Pip无法安装pyicu

Pip无法安装pyicu
EN

Stack Overflow用户
提问于 2021-07-12 23:16:10
回答 2查看 119关注 0票数 2

我正在运行一个运行Ubuntu 20.04的AWS。我正在尝试安装pyicu包,但我遇到了问题。我试过运行sudo apt install libicu-dev,但仍然无法安装pyicu。我无法在aws服务器上安装brew。还有其他建议吗?这是错误消息:

代码语言:javascript
复制
    ERROR: Command errored out with exit status 1:
     command: /root/dev/big5_rest/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-se360cxw/pyicu/setup.py'"'"'; __file__='"'"'/tmp/pip-install-se360cxw/pyicu/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-se360cxw/pyicu/pip-egg-info
         cwd: /tmp/pip-install-se360cxw/pyicu/
    Complete output (53 lines):
    Traceback (most recent call last):
      File "/tmp/pip-install-se360cxw/pyicu/setup.py", line 63, in <module>
        ICU_VERSION = os.environ['ICU_VERSION']
      File "/usr/lib/python3.8/os.py", line 675, in __getitem__
        raise KeyError(key) from None
    KeyError: 'ICU_VERSION'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-install-se360cxw/pyicu/setup.py", line 66, in <module>
        ICU_VERSION = check_output(('icu-config', '--version')).strip()
      File "/tmp/pip-install-se360cxw/pyicu/setup.py", line 19, in check_output
        return subprocess_check_output(popenargs)
      File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/lib/python3.8/subprocess.py", line 489, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'icu-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-install-se360cxw/pyicu/setup.py", line 69, in <module>
        ICU_VERSION = check_output(('pkg-config', '--modversion', 'icu-i18n')).strip()
      File "/tmp/pip-install-se360cxw/pyicu/setup.py", line 19, in check_output
        return subprocess_check_output(popenargs)
      File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/lib/python3.8/subprocess.py", line 489, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'pkg-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-se360cxw/pyicu/setup.py", line 71, in <module>
        raise RuntimeError('''
    RuntimeError:
    Please install pkg-config on your system or set the ICU_VERSION environment
    variable to the version of ICU you have installed.
    
    (running 'icu-config --version')
    (running 'pkg-config --modversion icu-i18n')
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
EN

回答 2

Stack Overflow用户

发布于 2021-07-26 10:33:25

  1. 只是阅读你长时间输出的实际建议

请在您的系统上安装pkg-config或将ICU_VERSION环境变量设置为您已安装的

版本。

  1. 最新的软件包版本或在最新的操作系统上使用可能会导致问题,因此请直接向authors https://gitlab.pyicu.org/main/pyicu/-/issues

提出问题

票数 0
EN

Stack Overflow用户

发布于 2021-11-26 16:31:10

这似乎是一个known issue with PyICU。与该帖子上的错误消息和建议相反,安装pkg-configlibicu-dev并没有为我解决这个问题。只有安装python3-icu (以recommended in the official PyICU docs的身份)才能最终修复它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68349833

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档