python - 没有名为“polyglot.text”的模块;'polyglot' 不是一个包
问题描述
我是 python 新手,我正在尝试在我的代码中导入 polyglot 模块。我已经安装了Polyglot 安装中解释的 polyglot ,一切都很顺利,但它仍然给我同样的错误。
ModuleNotFoundError: No module named 'polyglot.text'; 'polyglot' is not a package
当我在驱动器中检查 polyglot 时,它已安装在目录中
D:\Anaconda\Lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot
它在我的代码中具有所有需要的功能。我需要知道问题出在哪里?我需要解决它!
我需要导入以下函数:
from polyglot.transliteration import Transliterator
from polyglot.mapping import Embedding
from polyglot.load import load_embeddings
解决方案
尝试安装:
pip install polyglot numpy morfessor pycld2 pyicu
推荐阅读
- python - 如何删除
来自 facebook 洞察 API Python 的 json 对象的刺痛 - javascript - 反应:为什么调试器暂停两次,但 console.log 记录一次?
- javascript - 如何在水平布局中触发动画
- python - python:无法打开文件'manage.py':[Errno 2]撰写docker时没有这样的文件或目录
- crc - crc32关于数据流的功能说明
- c# - 无法使用 C# 中某个单元格的值更新现有的 excel 文件
- r - 如何使用函数填充 R 中的空向量?
- python - 有没有办法在 JSON 文件的字段上运行 spaCy NER?
- javascript - 访问路由器参数 VueJS
- angular - 角度表单阵列上的单选按钮无法正确切换