簡體   English   中英

在 continuumio/miniconda3:4.9.2 映像上安裝 PyICU

[英]Installing PyICU on continuumio/miniconda3:4.9.2 image

Unfortunately when using the Docker base: continuumio/miniconda3:4.9.2 from https://hub.docker.com/r/continuumio/miniconda3 and running: pip install PyICU==2.4.2 I get this error:

------                                                                                                                      
 > [ 5/10] RUN pip install PyICU==2.4.2:                                                                                    
#9 0.864 Collecting PyICU==2.4.2                                                                                            
#9 2.275   Downloading PyICU-2.4.2.tar.gz (219 kB)                                                                          
#9 3.115     ERROR: Command errored out with exit status 1:                                                                 
#9 3.115      command: /opt/conda/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k004hem9/pyicu/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k004hem9/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-pip-egg-info-bze17p9f
#9 3.115          cwd: /tmp/pip-install-k004hem9/pyicu/
#9 3.115     Complete output (53 lines):
#9 3.115     Package icu-i18n was not found in the pkg-config search path.
#9 3.115     Perhaps you should add the directory containing `icu-i18n.pc'
#9 3.115     to the PKG_CONFIG_PATH environment variable
#9 3.115     No package 'icu-i18n' found
#9 3.115     Traceback (most recent call last):
#9 3.115       File "/tmp/pip-install-k004hem9/pyicu/setup.py", line 62, in <module>
#9 3.115         ICU_VERSION = os.environ['ICU_VERSION']
#9 3.115       File "/opt/conda/lib/python3.8/os.py", line 675, in __getitem__
#9 3.115         raise KeyError(key) from None
#9 3.115     KeyError: 'ICU_VERSION'
#9 3.115     
#9 3.115     During handling of the above exception, another exception occurred:
#9 3.115     
#9 3.115     Traceback (most recent call last):
#9 3.115       File "/tmp/pip-install-k004hem9/pyicu/setup.py", line 65, in <module>
#9 3.115         ICU_VERSION = check_output(('icu-config', '--version')).strip()
#9 3.115       File "/tmp/pip-install-k004hem9/pyicu/setup.py", line 18, in check_output
#9 3.115         return subprocess_check_output(popenargs)
#9 3.115       File "/opt/conda/lib/python3.8/subprocess.py", line 411, in check_output
#9 3.115         return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
#9 3.115       File "/opt/conda/lib/python3.8/subprocess.py", line 489, in run
#9 3.115         with Popen(*popenargs, **kwargs) as process:
#9 3.115       File "/opt/conda/lib/python3.8/subprocess.py", line 854, in __init__
#9 3.115         self._execute_child(args, executable, preexec_fn, close_fds,
#9 3.115       File "/opt/conda/lib/python3.8/subprocess.py", line 1702, in _execute_child
#9 3.115         raise child_exception_type(errno_num, err_msg, err_filename)
#9 3.115     FileNotFoundError: [Errno 2] No such file or directory: 'icu-config'
#9 3.115     
#9 3.115     During handling of the above exception, another exception occurred:
#9 3.115     
#9 3.115     Traceback (most recent call last):
#9 3.115       File "/tmp/pip-install-k004hem9/pyicu/setup.py", line 68, in <module>
#9 3.115         ICU_VERSION = check_output(('pkg-config', '--modversion', 'icu-i18n')).strip()
#9 3.115       File "/tmp/pip-install-k004hem9/pyicu/setup.py", line 18, in check_output
#9 3.115         return subprocess_check_output(popenargs)
#9 3.115       File "/opt/conda/lib/python3.8/subprocess.py", line 411, in check_output
#9 3.115         return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
#9 3.115       File "/opt/conda/lib/python3.8/subprocess.py", line 512, in run
#9 3.115         raise CalledProcessError(retcode, process.args,
#9 3.115     subprocess.CalledProcessError: Command '('pkg-config', '--modversion', 'icu-i18n')' returned non-zero exit status 1.
#9 3.115     
#9 3.115     During handling of the above exception, another exception occurred:
#9 3.115     
#9 3.115     Traceback (most recent call last):
#9 3.115       File "<string>", line 1, in <module>
#9 3.115       File "/tmp/pip-install-k004hem9/pyicu/setup.py", line 70, in <module>
#9 3.115         raise RuntimeError('''
#9 3.115     RuntimeError:
#9 3.115     Please install pkg-config on your system or set the ICU_VERSION environment
#9 3.115     variable to the version of ICU you have installed.
#9 3.115     
#9 3.115     (running 'icu-config --version')
#9 3.115     (running 'pkg-config --modversion icu-i18n')
#9 3.115     ----------------------------------------
#9 3.115 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我也嘗試安裝這些軟件包,但是沒有運氣:

RUN apt-get update
RUN apt-get install -y sudo build-essential pkg-config gcc awscli jq vim 

有誰知道我缺少什么配置/我需要添加哪些包?

PyICU 是圍繞 C++ ICU 庫的 Python 包裝器。 您需要先安裝所述庫:

apt-get install libicu-dev

另見https://gitlab.pyicu.org/main/pyicu#installing-pyicu

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM