简体   繁体   English

在虚拟环境上安装python Polyglot软件包时出现问题

[英]Problems when installing python Polyglot package on virtual environment

I am trying to install several packages on a virtual environment on a Mac (OS X El Capitan 10.11.6). 我正在尝试在Mac(OS X El Capitan 10.11.6)的虚拟环境中安装几个软件包。 I have successfully installed polyglot (version 16.7.4). 我已经成功安装了polyglot(版本16.7.4)。 Everything works fine until I launched Python (version 3.6). 一切正常,直到我启动Python(3.6版)。

This is what I get as a result of a try to import text from polyglot. 这是我尝试从多语种导入文本的结果。

>>> 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'
>>> 

To create the virtual environment I ran the venv module as a script with the directory path. 为了创建虚拟环境,我将venv模块作为带有目录路径的脚本运行。

Any idea on what to do? 有什么想法吗?

The author of polyglot has forgotten to list requirements in setup.py so pip install polyglot doesn't install them automatically. polyglot的作者忘记了在setup.py列出要求 ,因此pip install polyglot不会自动安装它们。 Please report the bug to the issue tracker. 请将该错误报告给问题跟踪器。

Meanwhile dowload polyglot sources and run 同时下载多语种源并运行

pip install -r requirements.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM