从最近开始,每当我运行笔记本时,我都会收到此错误:
ModuleNotFoundError: No module named 'pytextrank'
虽然检查显示该库已安装,但 python 导入失败 - 我曾在不同的场景中遇到过此问题,并使用以下方法修复它:
python -m pip install pytextrank
但这没有任何影响,错误仍然存在。
这在过去不是问题,同样的笔记本运行良好 - 我认为这可能是一种回归。
有什么想法吗?任何有用的反馈将不胜感激。
这是我调用的代码:
import pytextrank
import sys
import networkx as nx
import pylab as plt
我在 colab 单元中得到了这个:
[nltk_data] Downloading package stopwords to /root/nltk_data...
[nltk_data] Unzipping corpora/stopwords.zip.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-7f30423e40f2> in <module>()
3 sys.path.insert(0, './awesome-ai-ml-dl/examples/better-nlp/library')
4
----> 5 from org.neomatrix369.better_nlp import BetterNLP
1 frames
/content/awesome-ai-ml-dl/examples/better-nlp/library/org/neomatrix369/summariser_pytextrank.py in <module>()
----> 1 import pytextrank
2 import sys
3 import networkx as nx
4 import pylab as plt
5
ModuleNotFoundError: No module named 'pytextrank'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.