-1

我正在尝试在 Mac(OS X El Capitan 10.11.6)上的虚拟环境中安装几个软件包。我已经成功安装了 polyglot(版本 16.7.4)。在我启动 Python(3.6 版)之前一切正常。

这是我尝试从多语言导入文本后得到的结果。

>>> import polyglot
>>> from polyglot import text
sh: grep: command not found
sh: sysctl: command not found
sh: sw_vers: command not found
sh: grep: command not found
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<WORKING DIRECTORY>/lib/python3.6/site-packages/polyglot/text.py", line 9, in <module>
from polyglot.detect import Detector, Language
  File "<WORKING DIRECTORY>/lib/python3.6/site-packages/polyglot/detect/__init__.py", line 1, in <module>
from .base import Detector, Language
  File "<WORKING DIRECTORY>/lib/python3.6/site-packages/polyglot/detect/base.py", line 11, in <module>
from icu import Locale
ModuleNotFoundError: No module named 'icu'
>>> 

为了创建虚拟环境,我将 venv 模块作为带有目录路径的脚本运行。

知道该怎么做吗?

4

1 回答 1

2

The author of polyglot has forgotten to list requirements in setup.py so pip install polyglot doesn't install them automatically. Please report the bug to the issue tracker.

Meanwhile dowload polyglot sources and run

pip install -r requirements.txt
于 2017-09-28T14:42:45.107 回答