簡體   English   中英

無法在 MacOS 上安裝 pyicu

[英]Unable to install pyicu on MacOS

我嘗試通過pip3 install pyicu並出現以下錯誤:

Collecting pyicu
Using cached https://files.pythonhosted.org/packages/bb/ef/3a7fcbba81bfd213e479131ae21445a2ddd14b46d70ef0109640b580bc5d/PyICU-2.0.3.tar.gz

Complete output from command python setup.py egg_info:

Building PyICU 2.0.3 for ICU 61

Could not configure CXXFLAGS with icu-config
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/80/v1nwf70x2rz5srmzfnpc3pq40000gn/T/pip-build-b_sify1x/pyicu/setup.py", line 131, in <module>
    _cflags, ('--cxxflags', '--cppflags'), 'CXXFLAGS')
  File "/private/var/folders/80/v1nwf70x2rz5srmzfnpc3pq40000gn/T/pip-build-b_sify1x/pyicu/setup.py", line 30, in configure_with_icu_config
    output = check_output(('icu-config',) + config_args).strip()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1326, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'icu-config'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/80/v1nwf70x2rz5srmzfnpc3pq40000gn/T/pip-build-b_sify1x/pyicu/

然后從某些來源我知道我需要安裝icu4c並通過.bash_profile為 icu 進行配置。 也嘗試這樣做,但錯誤仍然存​​在。 請幫幫我。

嘗試在命令行中運行它:

export PYICU_CFLAGS=-std=c++11:-DPYICU_VER='"2.0.3"'

暫無
暫無

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

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