首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在windows中安装polyglot

在windows中安装polyglot
EN

Stack Overflow用户
提问于 2020-05-20 13:26:08
回答 1查看 824关注 0票数 0

我想安装polyglot,但在安装过程中,像pyIcu或pycld2这样的安装要求会返回错误,因为它们在我下面插入的代码中已经很清楚了。我已经尝试安装pkg-config,但我的问题没有解决。

我不知道如何将ICU_VERSION环境变量设置为我已安装的ICU版本。

代码语言:javascript
复制
pip install polyglot
Requirement already satisfied: polyglot in c:\users\parsiran\anaconda3\lib\site-packages\polyglot-16.7.4-py3.7.egg (16.7.4)
Requirement already satisfied: numpy>=1.6.1 in c:\users\parsiran\anaconda3\lib\site-packages (from polyglot) (1.18.1)
Requirement already satisfied: wheel>=0.23.0 in c:\users\parsiran\anaconda3\lib\site-packages (from polyglot) (0.34.2)
Requirement already satisfied: six>=1.7.3 in c:\users\parsiran\anaconda3\lib\site-packages (from polyglot) (1.14.0)
Requirement already satisfied: morfessor>=2.0.2a1 in c:\users\parsiran\anaconda3\lib\site-packages\morfessor-2.0.6-py3.7.egg (from polyglot) (2.0.6)
Collecting pycld2>=0.3
  Using cached pycld2-0.41.tar.gz (41.4 MB)
Collecting PyICU>=1.8
  Using cached PyICU-2.4.3.tar.gz (219 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\ParsIran\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ParsIran\\AppData\\Local\\Temp\\pip-install-wp28hyt4\\PyICU\\setup.py'"'"'; __file__='"'"'C:\\Users\\ParsIran\\AppData\\Local\\Temp\\pip-install-wp28hyt4\\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 'C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\pip-egg-info'
         cwd: C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\
    Complete output (53 lines):
    (running 'icu-config --version')
    (running 'pkg-config --modversion icu-i18n')
    Traceback (most recent call last):
      File "C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\setup.py", line 62, in <module>
        ICU_VERSION = os.environ['ICU_VERSION']
      File "C:\Users\ParsIran\anaconda3\lib\os.py", line 679, 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 "C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\setup.py", line 65, in <module>
        ICU_VERSION = check_output(('icu-config', '--version')).strip()
      File "C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\setup.py", line 18, in check_output
        return subprocess_check_output(popenargs)
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 411, in check_output
        **kwargs).stdout
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 488, in run
        with Popen(*popenargs, **kwargs) as process:
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 800, in __init__
        restore_signals, start_new_session)
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 1207, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\setup.py", line 68, in <module>
        ICU_VERSION = check_output(('pkg-config', '--modversion', 'icu-i18n')).strip()
      File "C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\setup.py", line 18, in check_output
        return subprocess_check_output(popenargs)
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 411, in check_output
        **kwargs).stdout
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 488, in run
        with Popen(*popenargs, **kwargs) as process:
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 800, in __init__
        restore_signals, start_new_session)
      File "C:\Users\ParsIran\anaconda3\lib\subprocess.py", line 1207, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\ParsIran\AppData\Local\Temp\pip-install-wp28hyt4\PyICU\setup.py", line 73, in <module>
        ''')
    RuntimeError:
    Please install pkg-config on your system or set the ICU_VERSION environment
    variable to the version of ICU you have installed.

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
EN

回答 1

Stack Overflow用户

发布于 2020-05-20 13:48:59

PyICU是一个使用二进制文件的Python包。当尝试安装它时,python会下载源代码并尝试编译它:这就是为什么需要pkg-config和其他工具的原因。

另一种解决方案是安装一个包含二进制文件的版本。在这种情况下,您不需要编译工具来使其工作。

您可以下载here,这是适合您的Python安装的PyICU的编译版本。

我建议你阅读这些帖子AB,以获得详细的说明。

使用这些命令标识以下命令的版本(Python版本和32/64位平台)

代码语言:javascript
复制
python --version
python.exe -c "import struct;print(struct.calcsize('P') * 8)"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61905708

复制
相关文章

相似问题

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